Class CSVAlchemistSimulationAdapter
-
- All Implemented Interfaces:
-
it.unibo.alchemist.multivesta.adapter.AlchemistSimulationAdapter
public class CSVAlchemistSimulationAdapter implements AlchemistSimulationAdapter
This is a AlchemistSimulationAdapter that loads an already executed simulation's data from a CSV file. The file is chosen by randomly selecting a seed from the currently available seeds list and then by applying the filenameForSeed function to the selected seed. The selected seed is then removed from the available seeds list.
-
-
Field Summary
Fields Modifier and Type Field Description private final Integer
seed
private final File
rootOutputFiles
-
Constructor Summary
Constructors Constructor Description CSVAlchemistSimulationAdapter(Integer seed, File rootOutputFiles, Function1<Integer, String> filenameForSeed)
-
Method Summary
Modifier and Type Method Description final Integer
getSeed()
final File
getRootOutputFiles()
Double
getTime()
Get the simulation time. Double
rval(String obs)
Get the value for the given observation. Double
rval(Integer obsId)
Get the value for the given observation. Unit
doStep()
Perform a simulation step. Unit
performWholeSimulation()
Perform the whole simulation. -
-
Constructor Detail
-
CSVAlchemistSimulationAdapter
CSVAlchemistSimulationAdapter(Integer seed, File rootOutputFiles, Function1<Integer, String> filenameForSeed)
- Parameters:
seed
- the seed used to select the seed to use for the simulation, i.e.rootOutputFiles
- the root folder where the CSV files are storedfilenameForSeed
- the function that takes the selected seed and returns the filename corresponding to the simulation CSV file to load (the file must be in the rootOutputFiles folder)
-
-
Method Detail
-
getRootOutputFiles
final File getRootOutputFiles()
-
rval
Double rval(String obs)
Get the value for the given observation.
- Parameters:
obs
- the name of the observation
-
rval
Double rval(Integer obsId)
Get the value for the given observation.
- Parameters:
obsId
- the id of the observation
-
doStep
Unit doStep()
Perform a simulation step. In Alchemist this means that the simulation will be advanced of the number of step needed to reach the next time.
-
performWholeSimulation
Unit performWholeSimulation()
Perform the whole simulation.
-
-
-
-