API:ISimulation

From Wiketomica
Jump to: navigation, search
API Home Participants API Discussion Demos Downloads Documentation Contact Us Acknowledgements

ISimulation

Reason for existence

The ISimulation is a starting point and container for other top-level simulation objects: the IController, IRandom and IBoxs. The ISimulation also has an ISimulationEventManager.

Proposed Interface

interface ISimulation {

    /**
     * Adds a Phase to the simulation.  This method should not be called if
     * newPhase is already held by the simulation.
     */
    void addBox(IBox newBox);

    /**
     * Removes a Phase to the simulation.  This method should not be called if
     * oldPhase is not held by the simulation.
     */
    void removeBox(IBox oldBox);

    /**
     * The number of boxes contained in the simulation
     */
    readonly attribute int boxCount;

    /**
     * Returns Box specified by index contained in the simulation
     */
    public IBox getBox(int index);

    /**
     * Adds species to the list of all ISpecies in the simulation, and
     * adds notifies all IBoxes of the new ISpecies.
     */
    void addSpecies(ISpecies species);

    /**
     * Removes the given ISpecies from the simulation.
     */
    void removeSpecies(ISpecies removedSpecies);

    /**
     * The number of ISpecies in the simulation.
     */
    readonly attribute int speciesCount;

    /**
     * Returns the ISpecies in the simulation for the specified index.
     */
    ISpecies getSpecies(int index);

    /**
     * Returns the integrator for this simulation.
     */
    readonly attribute IIntegrator integrator;

    /**
     * Returns the Simulation's random number generator.
     */
    readonly attribute IRandom random;

    /**
     * Returns the Simulation's event manager, which fires events for
     * Phases and Species being added and removed.
     */
    readonly attribute ISimulationEventManager eventManager;
}

Use

Notes

Etomica's Simulation also holds a Space which acts as a factory for vectors and tensors appropriate for the simulation's dimensionality.