Class SingleDatasetSimulation
java.lang.Object
edu.cmu.tetrad.algcomparison.simulation.SingleDatasetSimulation
- All Implemented Interfaces:
Simulation
,HasParameters
,TetradSerializable
,Serializable
A
Simulation
implementation that returns a single supplied data set.- Author:
- josephramsey
- See Also:
-
Field Summary
Fields inherited from interface edu.cmu.tetrad.algcomparison.simulation.Simulation
serialVersionUID
-
Constructor Summary
ConstructorsConstructorDescriptionSingleDatasetSimulation
(DataSet dataSet) ASimulation
implementation that returns a single supplied data set. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createData
(Parameters parameters, boolean newModel) Creates a new data model for the simulation.getDataModel
(int index) Retrieves the data model at the specified index from this simulation.Retrieves the data type of the data set.Returns the description of the simulation.int
Returns the number of data models (1).Returns the list of parameters used in the simulation.Class
<? extends RandomGraph> Returns null, as there is not random graph for this simulation.Class
<? extends Simulation> Retrieves the class of the simulation.getTrueGraph
(int index) Gets the true graph for the simulation at the specified index.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.cmu.tetrad.algcomparison.simulation.Simulation
getShortName
-
Constructor Details
-
SingleDatasetSimulation
ASimulation
implementation that returns a single supplied data set.- Parameters:
dataSet
- The data set to return.
-
-
Method Details
-
createData
Creates a new data model for the simulation.- Specified by:
createData
in interfaceSimulation
- Parameters:
parameters
- the parameters for creating the data modelnewModel
- a flag indicating whether to create a new model
-
getNumDataModels
public int getNumDataModels()Returns the number of data models (1).- Specified by:
getNumDataModels
in interfaceSimulation
- Returns:
- The number of data models.
-
getTrueGraph
Gets the true graph for the simulation at the specified index.- Specified by:
getTrueGraph
in interfaceSimulation
- Parameters:
index
- The index of the desired true graph; must be 0.- Returns:
- null, since there is no true graph for this simulation.
-
getDataModel
Retrieves the data model at the specified index from this simulation.- Specified by:
getDataModel
in interfaceSimulation
- 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
Retrieves the data type of the data set.- Specified by:
getDataType
in interfaceSimulation
- Returns:
- The data type of the data set, which can be continuous, discrete, or mixed.
- Throws:
IllegalStateException
- If the data type is unknown.
-
getDescription
Returns the description of the simulation.- Specified by:
getDescription
in interfaceSimulation
- Returns:
- Returns a one-line description of the simulation, to be printed at the beginning of the report.
-
getParameters
Returns the list of parameters used in the simulation.- Specified by:
getParameters
in interfaceHasParameters
- Specified by:
getParameters
in interfaceSimulation
- Returns:
- The list of parameters used in the simulation.
-
getRandomGraphClass
Returns null, as there is not random graph for this simulation.- Specified by:
getRandomGraphClass
in interfaceSimulation
- Returns:
- null.
-
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 interfaceSimulation
- Returns:
- The class of the simulation.
-