public class Simulation extends java.lang.Object implements ISimulation
Modifier and Type | Field and Description |
---|---|
protected SimulationEventManager |
eventManager |
protected IRandom |
random |
protected int[] |
seeds |
protected ISpace |
space |
Constructor and Description |
---|
Simulation(ISpace space)
Creates a new simulation using the given space
|
Modifier and Type | Method and Description |
---|---|
void |
addBox(IBox newBox)
Adds a Box to the simulation.
|
void |
addSpecies(ISpecies species)
Adds species to the list of all ISpecies in the simulation, and
adds notifies all IBoxes of the new ISpecies.
|
protected void |
atomTypeAddedNotify(IAtomType newChildType) |
protected void |
atomTypeRemovedNotify(IAtomType removedType) |
IBox |
getBox(int index)
Returns an array of Boxs contained in the Simulation
|
int |
getBoxCount()
Returns number of boxes contained in the Simulation
|
Controller |
getController()
Returns the Controller used to run the simulation's Actions and
Activities.
|
ISimulationEventManager |
getEventManager()
Returns the Simulation's event manager, which fires events for
Boxes and Species being added and removed.
|
IIntegrator |
getIntegrator()
Returns the Simulation's primary integrator.
|
IRandom |
getRandom()
Returns the Simulation's random number generator.
|
int[] |
getRandomSeeds()
Returns the seeds that were used for the random number generator at
construction.
|
ISpace |
getSpace() |
ISpecies |
getSpecies(int index)
Returns the Species in the Simulation for the specified index.
|
int |
getSpeciesCount()
Returns the number of Species in the Simulation.
|
java.lang.String |
makeUniqueElementSymbol(java.lang.String symbolBase)
Returns an Element symbol starting with symbolBase that does not yet
exist in the Simulation.
|
void |
removeBox(IBox oldBox)
Removes a Box to the simulation.
|
void |
removeSpecies(ISpecies removedSpecies)
Removes the given ISpecies from the ISimulation.
|
void |
setRandom(IRandom newRandom)
Set the simulation's random number generator to the given one.
|
protected final ISpace space
protected int[] seeds
protected final SimulationEventManager eventManager
protected IRandom random
public Simulation(ISpace space)
public int[] getRandomSeeds()
public final void addBox(IBox newBox)
ISimulation
addBox
in interface ISimulation
public final void removeBox(IBox oldBox)
ISimulation
removeBox
in interface ISimulation
public final IBox getBox(int index)
getBox
in interface ISimulation
public int getBoxCount()
ISimulation
getBoxCount
in interface ISimulation
public Controller getController()
public final ISpace getSpace()
public IRandom getRandom()
ISimulation
getRandom
in interface ISimulation
public void setRandom(IRandom newRandom)
public ISimulationEventManager getEventManager()
ISimulation
getEventManager
in interface ISimulation
public void addSpecies(ISpecies species)
ISimulation
addSpecies
in interface ISimulation
public void removeSpecies(ISpecies removedSpecies)
ISimulation
removeSpecies
in interface ISimulation
public int getSpeciesCount()
ISimulation
getSpeciesCount
in interface ISimulation
public ISpecies getSpecies(int index)
ISimulation
getSpecies
in interface ISimulation
protected void atomTypeAddedNotify(IAtomType newChildType)
protected void atomTypeRemovedNotify(IAtomType removedType)
public java.lang.String makeUniqueElementSymbol(java.lang.String symbolBase)
public IIntegrator getIntegrator()
getIntegrator
in interface ISimulation