Class MultiWellExperiment<T>

  • Type Parameters:
    T - the type of model class that will run as a single "well"

    public class MultiWellExperiment<T>
    extends java.lang.Object
    MultiWellExperiments allow the user to visualize many models in a single GridWindow, and can be easily multithreaded for faster execution
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiWellExperiment​(int numWellsX, int numWellsY, T[] models, int visXdim, int visYdim, int scaleFactor, int borderColor, StepWell<T> StepFn, DrawWell<T> ColorFn)
      generates a MultiWellExperiment.
    • Method Summary

      Modifier and Type Method Description
      void LoadWells​(T[] models)
      loads a new set of models into the MultiWellExperiment
      void Run​(int numTicks, boolean multiThread, int tickPause)
      runs a multiwell experiment for a numTicks duration.
      void RunGIF​(int numTicks, java.lang.String outFileName, int recordPeriod, boolean multiThread)
      runs a multiwell experiment for a numTicks duration.
      void Step()
      runs a single timestep
      void StepMultiThread()
      runs a single multithreaded step
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • visXdim

        public final int visXdim
      • visYdim

        public final int visYdim
      • wellsX

        public final int wellsX
      • wellsY

        public final int wellsY
      • wells

        public T[] wells
    • Constructor Detail

      • MultiWellExperiment

        public MultiWellExperiment​(int numWellsX,
                                   int numWellsY,
                                   T[] models,
                                   int visXdim,
                                   int visYdim,
                                   int scaleFactor,
                                   int borderColor,
                                   StepWell<T> StepFn,
                                   DrawWell<T> ColorFn)
        generates a MultiWellExperiment. numWellsX, numWellsY define the number of well (model) rows, models[] is an array of the starting conditions of the models. visXdim, visYdim, scaleFactor define the x pixels, y pixels, and scaling of the visualization of each mdoel. borderColor defines the color of the separator between models, StepFn is a function argument. it takes a model, a well index, and a timestep as argument, and should update the model argument for one timestep. ColorFn is a function argument that takes a model, x, and y, and is used to set one pixel of the visualization.
    • Method Detail

      • LoadWells

        public void LoadWells​(T[] models)
        loads a new set of models into the MultiWellExperiment
      • StepMultiThread

        public void StepMultiThread()
        runs a single multithreaded step
      • Step

        public void Step()
        runs a single timestep
      • Run

        public void Run​(int numTicks,
                        boolean multiThread,
                        int tickPause)
        runs a multiwell experiment for a numTicks duration. if the multiThread boolean is set to true, the model execution will be multithreaded.
      • RunGIF

        public void RunGIF​(int numTicks,
                           java.lang.String outFileName,
                           int recordPeriod,
                           boolean multiThread)
        runs a multiwell experiment for a numTicks duration. if the multiThread boolean is set to true, the model execution will be multithreaded. saves every recordPeriod fames to a gif.