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
a3354fcb
Commit
a3354fcb
authored
Oct 09, 2018
by
Jose Ignacio Monreal Bailey
Browse files
Adding extension based on edge occupancy
parent
5c1198c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
a3354fcb
...
...
@@ -179,7 +179,18 @@ public class TraciSimulationController implements VehicleController, SimulationS
return
(
Double
)
object
;
}
@Override
@Override
public
int
getEdgeOccupancyRate
(
String
edgeIdFrom
)
{
SumoCommand
edgeCommand
=
Edge
.
getLastStepOccupancy
(
edgeIdFrom
);
Object
edgeObject
=
requestObject
(
edgeCommand
);
int
edgeOccupancyRate
=
(
int
)
Math
.
round
(((
Double
)
edgeObject
)*
100.0
);
return
edgeOccupancyRate
;
}
@Override
public
Location
getVehiclePosition
(
double
pStep
,
String
pVehicleID
)
{
if
(
pStep
==
_step
)
{
return
getVehiclePosition
(
pVehicleID
);
...
...
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/xml/XMLSimulationController.java
View file @
a3354fcb
...
...
@@ -108,7 +108,12 @@ public class XMLSimulationController implements VehicleController, SimulationSet
return
0
;
}
public
VehicleInformationContainer
requestVehicleInformation
(
String
pVehicleID
)
{
@Override
public
int
getEdgeOccupancyRate
(
String
edgeIdFrom
)
{
return
0
;
}
public
VehicleInformationContainer
requestVehicleInformation
(
String
pVehicleID
)
{
return
_vehicleDataInformationHandler
.
getVehiclePositions
().
get
(
pVehicleID
);
}
...
...
src/de/tud/kom/p2psim/impl/vehicular/trafficlights/DefaultTrafficLightInformationComponent.java
View file @
a3354fcb
...
...
@@ -161,6 +161,11 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
return
controller
.
getMinExpectedNumber
();
}
@Override
public
int
getEdgeOccupancyRate
(
String
edgeIdFrom
)
{
return
controller
.
getEdgeOccupancyRate
(
edgeIdFrom
);
}
@Override
public
void
initialize
()
{
...
...
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