Class SingleDatasetSimulation

java.lang.Object
edu.cmu.tetrad.algcomparison.simulation.SingleDatasetSimulation
All Implemented Interfaces:
Simulation, HasParameters, TetradSerializable, Serializable

public class SingleDatasetSimulation extends Object implements Simulation
A Simulation implementation that returns a single supplied data set.
Author:
josephramsey
See Also:
  • Constructor Details

    • SingleDatasetSimulation

      public SingleDatasetSimulation(DataSet dataSet)
      A Simulation implementation that returns a single supplied data set.
      Parameters:
      dataSet - The data set to return.
  • Method Details

    • createData

      public void createData(Parameters parameters, boolean newModel)
      Creates a new data model for the simulation.
      Specified by:
      createData in interface Simulation
      Parameters:
      parameters - the parameters for creating the data model
      newModel - a flag indicating whether to create a new model
    • getNumDataModels

      public int getNumDataModels()
      Returns the number of data models (1).
      Specified by:
      getNumDataModels in interface Simulation
      Returns:
      The number of data models.
    • getTrueGraph

      public Graph getTrueGraph(int index)
      Gets the true graph for the simulation at the specified index.
      Specified by:
      getTrueGraph in interface Simulation
      Parameters:
      index - The index of the desired true graph; must be 0.
      Returns:
      null, since there is no true graph for this simulation.
    • getDataModel

      public DataModel getDataModel(int index)
      Retrieves the data model at the specified index from this simulation.
      Specified by:
      getDataModel in interface Simulation
      Parameters:
      index - The index of the desired data model (must be 0).
      Returns:
      The data model at the specified index.
      Throws:
      IllegalArgumentException - if the index is not 0.
    • getDataType

      public DataType getDataType()
      Retrieves the data type of the data set.
      Specified by:
      getDataType in interface Simulation
      Returns:
      The data type of the data set, which can be continuous, discrete, or mixed.
      Throws:
      IllegalStateException - If the data type is unknown.
    • getDescription

      public String getDescription()
      Returns the description of the simulation.
      Specified by:
      getDescription in interface Simulation
      Returns:
      Returns a one-line description of the simulation, to be printed at the beginning of the report.
    • getParameters

      public List<String> getParameters()
      Returns the list of parameters used in the simulation.
      Specified by:
      getParameters in interface HasParameters
      Specified by:
      getParameters in interface Simulation
      Returns:
      The list of parameters used in the simulation.
    • getRandomGraphClass

      public Class<? extends RandomGraph> getRandomGraphClass()
      Returns null, as there is not random graph for this simulation.
      Specified by:
      getRandomGraphClass in interface Simulation
      Returns:
      null.
    • getSimulationClass

      public Class<? extends Simulation> getSimulationClass()
      Retrieves the class of the simulation. This method is used to retrieve the class of a simulation based on the selected simulations in the model.
      Specified by:
      getSimulationClass in interface Simulation
      Returns:
      The class of the simulation.