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
7ce68180
Commit
7ce68180
authored
Jul 24, 2018
by
Jose Ignacio Monreal Bailey
Browse files
Adding new changes for the input of the model of DrHe
parent
73bb2041
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
7ce68180
...
@@ -271,6 +271,15 @@ public class TraciSimulationController implements VehicleController, SimulationS
...
@@ -271,6 +271,15 @@ public class TraciSimulationController implements VehicleController, SimulationS
return
(
String
)
definitionObject
;
return
(
String
)
definitionObject
;
}
}
@Override
public
int
getLastStepVehicleNumber
(
String
edgeIdFrom
)
{
SumoCommand
lastStepVehicleNumberCommand
=
Edge
.
getLastStepVehicleNumber
(
edgeIdFrom
);
Object
lastStepVehicleNumberObject
=
requestObject
(
lastStepVehicleNumberCommand
);
int
lastStepVehicleNumber
=
((
Integer
)
lastStepVehicleNumberObject
).
intValue
();
return
lastStepVehicleNumber
;
}
@Override
@Override
public
boolean
nextStep
()
{
public
boolean
nextStep
()
{
if
(
Simulator
.
getEndTime
()
==
Simulator
.
getCurrentTime
())
{
if
(
Simulator
.
getEndTime
()
==
Simulator
.
getCurrentTime
())
{
...
@@ -345,6 +354,22 @@ public class TraciSimulationController implements VehicleController, SimulationS
...
@@ -345,6 +354,22 @@ public class TraciSimulationController implements VehicleController, SimulationS
execute
(
typeCommand
);
execute
(
typeCommand
);
}
}
@Override
public
RoadNetworkLane
getVehicleLaneId
(
String
pVehicleID
)
{
RoadNetworkLane
roadNetworkLane
=
null
;
String
laneId
=
""
;
SumoCommand
laneCommand
=
Vehicle
.
getLaneID
(
pVehicleID
);
Object
laneObject
=
requestObject
(
laneCommand
);
if
(
laneObject
!=
null
)
{
laneId
=
(
String
)
laneObject
;
roadNetworkLane
=
new
RoadNetworkLane
(
laneId
);
}
return
roadNetworkLane
;
}
/*
/*
@Override
@Override
public long getWaitingTime(String vehicleID) {
public long getWaitingTime(String vehicleID) {
...
...
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/xml/XMLSimulationController.java
View file @
7ce68180
...
@@ -16,10 +16,7 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
...
@@ -16,10 +16,7 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.SimulationSetupExtractor
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.SimulationSetupExtractor
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.TrafficLightController
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.TrafficLightController
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.VehicleController
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.VehicleController
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetwork
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.*
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkLink
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkRoute
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoAdditionalRouteAvailableException
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoAdditionalRouteAvailableException
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoExitAvailableException
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoExitAvailableException
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.trafficlights.TrafficLight
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.trafficlights.TrafficLight
;
...
@@ -240,6 +237,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
...
@@ -240,6 +237,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
return
null
;
return
null
;
}
}
@Override
public
int
getLastStepVehicleNumber
(
String
edgeIdFrom
)
{
return
0
;
}
@Override
@Override
public
double
getScenarioWidth
()
{
public
double
getScenarioWidth
()
{
return
-
1
;
return
-
1
;
...
@@ -299,6 +301,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
...
@@ -299,6 +301,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
_vehicleDataInformationHandler
.
getVehiclePositions
().
get
(
pVehicleID
).
setGap
(
gap
);
_vehicleDataInformationHandler
.
getVehiclePositions
().
get
(
pVehicleID
).
setGap
(
gap
);
}
}
@Override
public
RoadNetworkLane
getVehicleLaneId
(
String
pVehicleID
)
{
return
null
;
}
/*
/*
@Override
@Override
public long getWaitingTime(String vehicleID) {
public long getWaitingTime(String vehicleID) {
...
...
src/de/tud/kom/p2psim/impl/vehicular/DefaultVehicleInformationComponent.java
View file @
7ce68180
...
@@ -37,6 +37,7 @@ import de.tudarmstadt.maki.simonstrator.api.component.vehicular.VehicleInformati
...
@@ -37,6 +37,7 @@ import de.tudarmstadt.maki.simonstrator.api.component.vehicular.VehicleInformati
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.SimulationSetupExtractor
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.SimulationSetupExtractor
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.VehicleController
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.VehicleController
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkLane
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkRoute
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkRoute
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoAdditionalRouteAvailableException
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoAdditionalRouteAvailableException
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoExitAvailableException
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoExitAvailableException
;
...
@@ -183,6 +184,11 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
...
@@ -183,6 +184,11 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
return
controller
.
getCurrentRoute
(
vehicleID
);
return
controller
.
getCurrentRoute
(
vehicleID
);
}
}
@Override
public
RoadNetworkLane
getVehicleLaneId
()
{
return
controller
.
getVehicleLaneId
(
vehicleID
);
}
@Override
@Override
public
boolean
changeCurrentRoute
(
RoadNetworkRoute
pRoute
)
{
public
boolean
changeCurrentRoute
(
RoadNetworkRoute
pRoute
)
{
controller
.
rerouteVehicle
(
vehicleID
,
pRoute
);
controller
.
rerouteVehicle
(
vehicleID
,
pRoute
);
...
...
src/de/tud/kom/p2psim/impl/vehicular/trafficlights/DefaultTrafficLightInformationComponent.java
View file @
7ce68180
...
@@ -93,7 +93,7 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
...
@@ -93,7 +93,7 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
}
}
@Override
@Override
public
void
setPhas
a
eDuration
(
String
trafficLightId
,
int
extraTime
)
{
public
void
setPhaseDuration
(
String
trafficLightId
,
int
extraTime
)
{
controller
.
setPhaseDuration
(
trafficLightId
,
extraTime
);
controller
.
setPhaseDuration
(
trafficLightId
,
extraTime
);
}
}
...
@@ -107,6 +107,11 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
...
@@ -107,6 +107,11 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
return
controller
.
getDefinition
(
trafficLightId
);
return
controller
.
getDefinition
(
trafficLightId
);
}
}
@Override
public
int
getLastStepVehicleNumber
(
String
edgeIdFrom
)
{
return
controller
.
getLastStepVehicleNumber
(
edgeIdFrom
);
}
@Override
@Override
public
void
initialize
()
{
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