Class SyncCheckSim
java.lang.Object
com.prineside.tdi2.utils.simulation.AbstractSimulation
com.prineside.tdi2.utils.simulation.SyncCheckSim
- All Implemented Interfaces:
Simulation
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.prineside.tdi2.utils.simulation.Simulation
Simulation.LogListener -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Scenariofinal intfinal intfinal com.badlogic.gdx.utils.Array<ObjectPair<String,Scenario>> final SimConfigfinal intFields inherited from interface com.prineside.tdi2.utils.simulation.Simulation
LOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_WARNING -
Constructor Summary
ConstructorsConstructorDescriptionSyncCheckSim(SimConfig simConfig, com.badlogic.gdx.utils.Array<ObjectPair<String, Scenario>> scenarios, Scenario extraLoadScenario, int parallelThreads, int extraLoadThreads, int syncCheckFrameInterval) -
Method Summary
Modifier and TypeMethodDescriptiongetName()floatbooleanbooleanbooleanstatic voidprepareSimForm(SimulationScreen simScreen) voidsetSimFinishListener(Runnable onFinish) voidstart()voidstop()Methods inherited from class com.prineside.tdi2.utils.simulation.AbstractSimulation
log, log, setSimLogListener
-
Field Details
-
simConfig
-
syncCheckFrameInterval
public final int syncCheckFrameInterval -
parallelThreads
public final int parallelThreads -
extraLoadThreads
public final int extraLoadThreads -
scenarios
-
extraLoadScenario
-
-
Constructor Details
-
SyncCheckSim
public SyncCheckSim(SimConfig simConfig, com.badlogic.gdx.utils.Array<ObjectPair<String, Scenario>> scenarios, Scenario extraLoadScenario, int parallelThreads, int extraLoadThreads, int syncCheckFrameInterval) - Parameters:
scenarios- scenarios to sync check for, will be executed in orderextraLoadScenario- (may be null) scenario for an extra load, if extraLoadThreads > 0. Must run longer than any of the sync-checked scenarios with sync checksparallelThreads- (2+) number of parallel threads running that will be sync checkedextraLoadThreads- (0+) number of extra load threads that will run extraLoadScenario in parallel just to increase the chance of desync / make additional load on the memorysyncCheckFrameInterval- (1+) interval of sync checks in frames. If set to 1, each instance of GSP will also do an additional logging (GameSystemProvider.syncChecking = true) to increase the chance to find a desync
-
-
Method Details
-
prepareSimForm
-
getName
-
setSimFinishListener
-
getProgress
public float getProgress() -
start
public void start() -
isRunning
public boolean isRunning() -
isReadyToStart
public boolean isReadyToStart() -
isSuccessful
public boolean isSuccessful() -
stop
public void stop()
-