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
5c1198c6
Commit
5c1198c6
authored
Sep 27, 2018
by
jimonreal
Committed by
Jose Ignacio Monreal Bailey
Aug 20, 2019
Browse files
Stopping simulation when there is no vehicle
parent
fee642a0
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/simengine/Simulator.java
View file @
5c1198c6
...
@@ -31,6 +31,7 @@ import java.util.Map;
...
@@ -31,6 +31,7 @@ import java.util.Map;
import
java.util.Random
;
import
java.util.Random
;
import
de.tud.kom.p2psim.impl.util.Summary
;
import
de.tud.kom.p2psim.impl.util.Summary
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.SUMOController
;
import
org.apache.commons.math.random.JDKRandomGenerator
;
import
org.apache.commons.math.random.JDKRandomGenerator
;
import
org.apache.commons.math.random.RandomGenerator
;
import
org.apache.commons.math.random.RandomGenerator
;
...
@@ -552,4 +553,8 @@ public class Simulator implements RandomGeneratorComponent, GlobalComponent {
...
@@ -552,4 +553,8 @@ public class Simulator implements RandomGeneratorComponent, GlobalComponent {
public
void
addObserver
(
SimulatorObserver
observer
)
{
public
void
addObserver
(
SimulatorObserver
observer
)
{
observers
.
add
(
observer
);
observers
.
add
(
observer
);
}
}
public
void
setRunning
(
boolean
b
)
{
this
.
running
=
b
;
}
}
}
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
5c1198c6
...
@@ -16,10 +16,7 @@ import de.tud.kom.p2psim.impl.topology.PositionVector;
...
@@ -16,10 +16,7 @@ import de.tud.kom.p2psim.impl.topology.PositionVector;
import
de.tud.kom.p2psim.impl.topology.movement.vehicular.sumo.simulation.controller.VehicleInformationContainer
;
import
de.tud.kom.p2psim.impl.topology.movement.vehicular.sumo.simulation.controller.VehicleInformationContainer
;
import
de.tudarmstadt.maki.simonstrator.api.Randoms
;
import
de.tudarmstadt.maki.simonstrator.api.Randoms
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.EdgeController
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.*
;
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.VehicleController
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.information.LocationUtils
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.information.LocationUtils
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.*
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.*
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoAdditionalRouteAvailableException
;
import
de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoAdditionalRouteAvailableException
;
...
@@ -1196,4 +1193,13 @@ public class TraciSimulationController implements VehicleController, SimulationS
...
@@ -1196,4 +1193,13 @@ public class TraciSimulationController implements VehicleController, SimulationS
}
}
return
false
;
return
false
;
}
}
@Override
public
int
getMinExpectedNumber
()
{
SumoCommand
simulationCommand
=
Simulation
.
getMinExpectedNumber
();
Object
objectSimulation
=
requestObject
(
simulationCommand
);
int
expectedNumber
=
(
int
)
objectSimulation
;
return
expectedNumber
;
}
}
}
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/xml/XMLSimulationController.java
View file @
5c1198c6
...
@@ -93,6 +93,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
...
@@ -93,6 +93,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
return
false
;
return
false
;
}
}
@Override
public
int
getMinExpectedNumber
()
{
return
0
;
}
@Override
@Override
public
Location
getVehiclePosition
(
String
pVehicleID
)
{
public
Location
getVehiclePosition
(
String
pVehicleID
)
{
return
getVehiclePosition
(
_step
,
pVehicleID
);
return
getVehiclePosition
(
_step
,
pVehicleID
);
...
...
src/de/tud/kom/p2psim/impl/vehicular/DefaultVehicleInformationComponent.java
View file @
5c1198c6
...
@@ -120,6 +120,10 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
...
@@ -120,6 +120,10 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
}
}
}
}
public
VehicleController
getController
()
{
return
controller
;
}
@Override
@Override
public
void
setVehicleID
(
String
pVehicleID
)
{
public
void
setVehicleID
(
String
pVehicleID
)
{
vehicleID
=
pVehicleID
;
vehicleID
=
pVehicleID
;
...
...
src/de/tud/kom/p2psim/impl/vehicular/trafficlights/DefaultTrafficLightInformationComponent.java
View file @
5c1198c6
...
@@ -37,6 +37,10 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
...
@@ -37,6 +37,10 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
return
numberOfMessagesSent
;
return
numberOfMessagesSent
;
}
}
public
TrafficLightController
getController
()
{
return
controller
;
}
@Override
@Override
public
void
setTrafficLightId
(
String
pTrafficLightId
)
{
public
void
setTrafficLightId
(
String
pTrafficLightId
)
{
trafficLightId
=
pTrafficLightId
;
trafficLightId
=
pTrafficLightId
;
...
@@ -152,6 +156,11 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
...
@@ -152,6 +156,11 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
return
controller
.
getVehicleMaxSpeed
(
vehicleId
);
return
controller
.
getVehicleMaxSpeed
(
vehicleId
);
}
}
@Override
public
int
getMinExpectedNumber
()
{
return
controller
.
getMinExpectedNumber
();
}
@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