DefaultSimulator

public class DefaultSimulator extends AbstractSimulator

The basic simulation engine from which others may be derived.

Author:Marcel Stefko, Kyle M. Douglass

Fields

LOGGER

public static final Logger LOGGER

Constructors

DefaultSimulator

public DefaultSimulator(Microscope microscope)

Initialize the generator.

Parameters:
  • microscope

Methods

getCameraJsonName

public String getCameraJsonName()

Returns the JSON member name assigned to the camera.

Returns:The JSON member name for the Camera field.

getControlSignal

public double getControlSignal()

getCustomParameters

public HashMap<String, Double> getCustomParameters()

getFOVSize

public double getFOVSize()
Returns:The size of the FOV in square object-space units.

getFluorescenceJsonName

public String getFluorescenceJsonName()

Returns the name of the JSON key for the fluorescence info.

Returns:The name of the key indicating the fluorescence information.

getLaserJsonName

public String getLaserJsonName()

Returns the name of the JSON key for the laser info.

Returns:The name of the key indicating the laser information.

getMessages

public List<Message> getMessages()

Returns messages about changes in the simulation state. Unlike getSimulationState(), which returns information about the current state of the simulation, this method returns the messages from individual components that contain information about changes in their state that have occurred since the last time this method was called.

Returns:A list containing the state change messages.

getMicroscope

public Microscope getMicroscope()

Returns a copy of the Microscope that is controlled by this simulation. The copy that is returned is a deep copy of the Microscope that the simulation was initialized with.

Returns:A copy of the Microscope object controlled by this simulation.

getNextImage

public ImageS getNextImage()

Generates a new image and adds it to the internal stack.

Returns:newly generated image

getObjectSpacePixelSize

public double getObjectSpacePixelSize()
Returns:Length of one pixel side in object-space units.

getObjectiveJsonName

public String getObjectiveJsonName()

Returns the name of the JSON key for the objective state info.

Returns:The name of the key indicating the objective information.

See also: .toJsonState()

getShortTrueSignalDescription

public String getShortTrueSignalDescription()

getStageJsonName

public String getStageJsonName()

Returns the name of the JSON key for the stage info.

Returns:The name of the key indicating the stage information.

getStateListener

public DefaultSimulator.StateListener getStateListener()

Returns this instance’s StateListener. This method is primarily for testing purposes and is not exposed in the Simulator interface.

Returns:A reference to this instance’s StateListener.

getTrueSignal

public double getTrueSignal(int image_no)

incrementTimeStep

public void incrementTimeStep()

Advance the simulation by one time step (i.e. one frame). Simulates a frame but does not create an image.

saveMessages

public void saveMessages(File file)

Saves the messages in the cache to a select file.

Parameters:
  • file – The file to save to.

saveState

public void saveState(File file)

Saves the current state of the simulation.

Parameters:
  • file – The file to save to.

setControlSignal

public void setControlSignal(double value)

setCustomParameters

public void setCustomParameters(HashMap<String, Double> map)

toJsonMessages

public JsonElement toJsonMessages()

Returns messages about changes in the simulation state as a JSON object. Unlike toJsonState(), which returns information about the current state of the simulation, this method returns the messages from individual simulation components that contain information about changes in their state that have occurred since the last time this method was called.

Returns:A JSON object containing the simulation messages.

toJsonState

public JsonElement toJsonState()

Returns information on the simulation’s current state as a JSON object. Unlike toJsonMessages(), which returns information about previous changes in the simulation’s state, this method reports on the current state of the simulation.

Returns:A JSON object containing information on the simulation state.