Class SemSimulation
java.lang.Object
edu.cmu.tetrad.algcomparison.simulation.SemSimulation
- All Implemented Interfaces:
Simulation
,HasParameters
,TetradSerializable
,Serializable
This class represents a Simulation using Structural Equation Modeling (SEM).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSemSimulation
(RandomGraph graph) Constructs a SemSimulation object with the given RandomGraph object.SemSimulation
(SemIm im) Constructs a GeneralSemSimulation object with the given SemIm object.SemSimulation
(SemPm pm) Initializes a SemSimulation with the given SemPm object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
createData
(Parameters parameters, boolean newModel) Creates data sets for simulation based on the given parameters and model reuse preference.getDataModel
(int index) Returns the data model at the specified index.Returns the data type of the data set.Returns the description of the simulation.getIms()
Retrieves the list of SemIm objects used for simulation.int
Returns the number of data models.Retrieves the parameters required for the simulation.Class
<? extends RandomGraph> Retrieves the class of a random graph for the simulation.Returns the short name of the simulation.Class
<? extends Simulation> Returns the class of the simulation.getTrueGraph
(int index) Returns the true graph at the specified index.
-
Constructor Details
-
SemSimulation
Constructs a SemSimulation object with the given RandomGraph object.- Parameters:
graph
- the RandomGraph object used for simulation.- Throws:
NullPointerException
- if graph is null.
-
SemSimulation
Initializes a SemSimulation with the given SemPm object.- Parameters:
pm
- the SemPm object used for simulation.- Throws:
NullPointerException
- if pm is null.
-
SemSimulation
Constructs a GeneralSemSimulation object with the given SemIm object.- Parameters:
im
- the SemIm object used for simulation
-
-
Method Details
-
createData
Creates data sets for simulation based on the given parameters and model reuse preference.- Specified by:
createData
in interfaceSimulation
- Parameters:
parameters
- The parameters to use in the simulation.newModel
- If true, a new model is created. If false, the model is reused.
-
getIms
-
getTrueGraph
Returns the true graph at the specified index.- Specified by:
getTrueGraph
in interfaceSimulation
- Parameters:
index
- The index of the desired true graph.- Returns:
- The true graph at the specified index.
-
getNumDataModels
public int getNumDataModels()Returns the number of data models.- Specified by:
getNumDataModels
in interfaceSimulation
- Returns:
- The number of data sets to simulate.
-
getDataModel
Returns the data model at the specified index.- Specified by:
getDataModel
in interfaceSimulation
- Parameters:
index
- The index of the desired simulated data set.- Returns:
- The data model at the specified index.
-
getDataType
Returns the data type of the data set.- Specified by:
getDataType
in interfaceSimulation
- Returns:
- The type of the data set--continuous if all continuous variables, discrete if all discrete variables; otherwise, mixed.
-
getDescription
Returns the description of the simulation.- Specified by:
getDescription
in interfaceSimulation
- Returns:
- a short, one-line description of the simulation.
-
getShortName
Returns the short name of the simulation.- Specified by:
getShortName
in interfaceSimulation
- Returns:
- The short name of the simulation.
-
getParameters
Retrieves the parameters required for the simulation.- Specified by:
getParameters
in interfaceHasParameters
- Specified by:
getParameters
in interfaceSimulation
- Returns:
- A list of String names representing the parameters.
-
getRandomGraphClass
Description copied from interface:Simulation
Retrieves the class of a random graph for the simulation.- Specified by:
getRandomGraphClass
in interfaceSimulation
- Returns:
- The class of a random graph for the simulation.
-
getSimulationClass
Description copied from interface:Simulation
Returns 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.
-