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
17c5d7d6
Commit
17c5d7d6
authored
Apr 16, 2018
by
jimonreal
Committed by
Jose Ignacio Monreal Bailey
Aug 20, 2019
Browse files
Adding VehicleType
parent
7328ee2b
Changes
3
Show whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/VehicleMovementModel.java
View file @
17c5d7d6
...
...
@@ -394,4 +394,8 @@ public class VehicleMovementModel implements MovementModel, EventHandler {
public
static
RoadNetwork
getRoadNetwork
()
{
return
MOVEMENT
.
_extractor
.
getRoadNetwork
();
}
public
static
String
getVehicleType
(
String
pVehicleID
)
{
return
MOVEMENT
.
_controller
.
getVehicleType
(
pVehicleID
);
}
}
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
17c5d7d6
...
...
@@ -38,12 +38,7 @@ import de.tudresden.sumo.cmd.Lane;
import
de.tudresden.sumo.cmd.Simulation
;
import
de.tudresden.sumo.cmd.Vehicle
;
import
de.tudresden.sumo.util.SumoCommand
;
import
de.tudresden.ws.container.SumoBoundingBox
;
import
de.tudresden.ws.container.SumoGeometry
;
import
de.tudresden.ws.container.SumoLink
;
import
de.tudresden.ws.container.SumoLinkList
;
import
de.tudresden.ws.container.SumoPosition2D
;
import
de.tudresden.ws.container.SumoStringList
;
import
de.tudresden.ws.container.*
;
import
edu.emory.mathcs.backport.java.util.Collections
;
import
it.polito.appeal.traci.SumoTraciConnection
;
...
...
@@ -250,6 +245,20 @@ public class TraciSimulationController implements VehicleController, SimulationS
return
false
;
}
public
String
getVehicleType
(
String
pVehicleID
)
{
String
vehicleType
=
"private"
;
SumoCommand
typeCommand
=
Vehicle
.
getTypeID
(
pVehicleID
);
Object
typeObject
=
requestObject
(
typeCommand
);
if
(
typeObject
!=
null
)
{
vehicleType
=
(
String
)
typeObject
;
}
return
vehicleType
;
}
private
Location
requestVehiclePosition
(
String
pVehicleID
)
{
if
(
_vehiclesOutOfRange
.
containsKey
(
pVehicleID
))
{
if
(
_vehiclesOutOfRange
.
get
(
pVehicleID
)
<
_step
)
{
...
...
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/xml/XMLSimulationController.java
View file @
17c5d7d6
...
...
@@ -205,9 +205,13 @@ public class XMLSimulationController implements VehicleController, SimulationSet
throw
new
UnsupportedOperationException
(
"This method is not supported for "
+
getClass
().
getSimpleName
());
}
@Override
public
String
getVehicleType
(
String
pVehicleID
)
{
return
null
;
}
@Override
public
double
getVehicleSpeed
(
String
pVehicleID
)
{
return
_vehicleDataInformationHandler
.
getVehiclePositions
().
get
(
pVehicleID
).
getSpeed
();
}
}
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