Class DefaultObjectCreationProcess
- java.lang.Object
-
- jadex.commons.SimplePropertyObject
-
- jadex.extension.envsupport.environment.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).
$clock
.
-
-
Field Summary
Fields Modifier and Type Field Description protected SimpleValueFetcher
fetcher
The fetcher.protected double
lastrate
The last rate.protected double
lasttick
The last executed tick.protected double
lasttime
The last executed time.-
Fields inherited from class jadex.commons.SimplePropertyObject
pcs, properties
-
Fields inherited from interface jadex.extension.envsupport.environment.ISpaceProcess
ID
-
-
Constructor Summary
Constructors Constructor Description DefaultObjectCreationProcess()
Create a new create food process.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(IClockService clock, IEnvironmentSpace space)
Executes the environment processjava.lang.Object
getProperty(java.lang.String name)
Returns a property.void
shutdown(IEnvironmentSpace space)
This method will be executed by the object before the process is removed from the execution queue.void
start(IClockService clock, IEnvironmentSpace space)
This method will be executed by the object before the process gets added to the execution queue.-
Methods inherited from class jadex.commons.SimplePropertyObject
addPropertyChangeListener, getProperties, getPropertyNames, hasProperty, removePropertyChangeListener, setProperties, setProperty, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jadex.commons.IPropertyObject
getPropertyNames, hasProperty, setProperty
-
-
-
-
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.
-
fetcher
protected SimpleValueFetcher fetcher
The fetcher.
-
-
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 interfaceISpaceProcess
- 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 interfaceISpaceProcess
- Parameters:
clock
- The clock.space
- The space this process is running in.
-
execute
public void execute(IClockService clock, IEnvironmentSpace space)
Executes the environment process- Specified by:
execute
in interfaceISpaceProcess
- Parameters:
clock
- The clock.space
- The space this process is running in.
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Returns a property.- Specified by:
getProperty
in interfaceIPropertyObject
- Overrides:
getProperty
in classSimplePropertyObject
- Parameters:
name
- name of the property- Returns:
- the property
-
-