|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.tudelft.simulation.event.EventProducer
nl.tudelft.simulation.dsol.formalisms.flow.Station
nl.tudelft.simulation.dsol.formalisms.flow.Generator
public class Generator
This class defines a generator
(c) copyright 2002-2005 Delft
University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser
General Public License (LGPL) , no warranty.
Field Summary | |
---|---|
protected SerializableConstructor |
constructor
constructor refers to the constructor to be invoked |
protected Object[] |
constructorArguments
constructorArguments refer to the arguments invoked by the |
static EventType |
CREATE_EVENT
CREATE_EVENT is fired on creation |
protected DistContinuous |
interval
interval defines the inter construction time |
protected SimEvent |
nextEvent
nextEvent refers to the next simEvent |
protected DistContinuous |
startTime
startTime defines the absolute startTime for the generator |
Fields inherited from class nl.tudelft.simulation.dsol.formalisms.flow.Station |
---|
destination, simulator |
Fields inherited from class nl.tudelft.simulation.event.EventProducer |
---|
listeners |
Fields inherited from interface nl.tudelft.simulation.dsol.formalisms.flow.StationInterface |
---|
RECEIVE_EVENT, RELEASE_EVENT |
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface |
---|
FIRST_POSITION, LAST_POSITION |
Constructor Summary | |
---|---|
Generator(DEVSSimulatorInterface simulator,
Class myClass,
Object[] constructorArguments)
constructs a new generator for objects in a simulation. |
Method Summary | |
---|---|
void |
generate()
generates a new entity with the basic constructorArguments |
void |
generate(Object[] constructorArguments)
generates a new entity |
DistDiscrete |
getBatchSize()
returns the batchSize |
DistContinuous |
getInterval()
returns the interarrival intercal |
long |
getMaxNumber()
returns the maximum number of entities to be created |
DistContinuous |
getStartTime()
returns the startTime of the generator |
void |
receiveObject(Object object)
receives an object is invoked whenever an entity arrives |
void |
setBatchSize(DistDiscrete batchSize)
sets the batchsize of the generator |
void |
setInterval(DistContinuous interval)
sets the interarrival distribution |
void |
setMaxNumber(long maxNumber)
sets the maximum number of entities to be created |
void |
setStartTime(DistContinuous startTime)
sets the startTime |
Methods inherited from class nl.tudelft.simulation.dsol.formalisms.flow.Station |
---|
getDestination, releaseObject, setDestination |
Methods inherited from class nl.tudelft.simulation.event.EventProducer |
---|
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface |
---|
addListener, addListener, addListener, addListener, getEventTypes, removeListener |
Field Detail |
---|
public static final EventType CREATE_EVENT
protected Object[] constructorArguments
protected DistContinuous interval
protected DistContinuous startTime
protected SerializableConstructor constructor
protected SimEvent nextEvent
Constructor Detail |
---|
public Generator(DEVSSimulatorInterface simulator, Class myClass, Object[] constructorArguments) throws SimRuntimeException
simulator
- is the on which the construction of the objects must be
scheduled.myClass
- is the class of which entities are createdconstructorArguments
- are the parameters for the constructor of
myClass. of arguments.
constructorArgument[n]=new Integer(12)
may have
constructorArgumentClasses[n]=int.class;
SimRuntimeException
- on constructor invokation.Method Detail |
---|
public void generate() throws SimRuntimeException
SimRuntimeException
- on construction failurepublic void generate(Object[] constructorArguments) throws SimRuntimeException
constructorArguments
- are the parameters used in the constructor.
SimRuntimeException
- on construction failurepublic void receiveObject(Object object)
StationInterface
receiveObject
in interface StationInterface
receiveObject
in class Station
object
- is the entityStationInterface.receiveObject(Object)
public DistDiscrete getBatchSize()
public DistContinuous getInterval()
public long getMaxNumber()
public void setBatchSize(DistDiscrete batchSize)
batchSize
- is the number of entities simultaniously constructedpublic void setInterval(DistContinuous interval)
interval
- is the interarrival timepublic void setMaxNumber(long maxNumber)
maxNumber
- is the maxNumberpublic DistContinuous getStartTime()
public void setStartTime(DistContinuous startTime)
startTime
- is the absolute startTime
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |