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.

    • 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 stored
        filenameForSeed - 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

      • 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.