Class DefaultObjectCreationProcess

  • All Implemented Interfaces:
    IPropertyObject, ISpaceProcess

    public class DefaultObjectCreationProcess
    extends SimplePropertyObject
    implements ISpaceProcess
    Process for continuously creating objects in the space. The following properties are supported: type: The type of the object to be created (String, required). properties: The initial properties of the object (Map, optional). condition: A condition to enable/disable object creation (boolean, optional). tickrate: Number of ticks between object creation (double, optional, 0 == off). timerate: Number of milliseconds between object creation (double, optional, 0 == off). $space and to the clock service using $clock.
    • Field Detail

      • lasttick

        protected double lasttick
        The last executed tick.
      • lasttime

        protected double lasttime
        The last executed time.
      • lastrate

        protected double lastrate
        The last rate.
    • Constructor Detail

      • DefaultObjectCreationProcess

        public DefaultObjectCreationProcess()
        Create a new create food process.
    • Method Detail

      • start

        public void start​(IClockService clock,
                          IEnvironmentSpace space)
        This method will be executed by the object before the process gets added to the execution queue.
        Specified by:
        start in interface ISpaceProcess
        Parameters:
        clock - The clock.
        space - The space this process is running in.
      • shutdown

        public void shutdown​(IEnvironmentSpace space)
        This method will be executed by the object before the process is removed from the execution queue.
        Specified by:
        shutdown in interface ISpaceProcess
        Parameters:
        clock - The clock.
        space - The space this process is running in.