Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
5540da20
Commit
5540da20
authored
Jul 17, 2017
by
Tobias Meuser
Browse files
Added speed sensor
parent
3e8abc02
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/VehicleController.java
View file @
5540da20
...
...
@@ -36,5 +36,6 @@ public interface VehicleController {
void
init
();
double
getVehicleSpeed
(
String
pVehicleID
);
void
stopVehicle
(
String
pVehicle
);
}
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
5540da20
...
...
@@ -597,4 +597,13 @@ public class TraciSimulationController implements VehicleController, SimulationS
return
angle
;
}
@Override
public
double
getVehicleSpeed
(
String
pVehicleID
)
{
SumoCommand
speedCommand
=
Vehicle
.
getSpeed
(
pVehicleID
);
Object
object
=
requestObject
(
speedCommand
);
System
.
out
.
println
(
object
.
getClass
());
return
(
Double
)
object
;
}
}
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/xml/XMLSimulationController.java
View file @
5540da20
...
...
@@ -204,4 +204,9 @@ public class XMLSimulationController implements VehicleController, SimulationSet
throw
new
UnsupportedOperationException
(
"This method is not supported for "
+
getClass
().
getSimpleName
());
}
@Override
public
double
getVehicleSpeed
(
String
pVehicleID
)
{
throw
new
UnsupportedOperationException
(
"This method is not supported for "
+
getClass
().
getSimpleName
());
}
}
src/de/tud/kom/p2psim/impl/vehicular/DefaultVehicleInformationComponent.java
View file @
5540da20
...
...
@@ -110,4 +110,9 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
controller
.
stopVehicle
(
vehicleID
);
}
@Override
public
double
getCurrentSpeed
()
{
return
controller
.
getVehicleSpeed
(
vehicleID
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment