Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nl.tudelft.simulation.dsol.formalisms.flow
Class Generator

    java.lang.Object
      nl.tudelft.simulation.event.EventProducer
          nl.tudelft.simulation.dsol.formalisms.flow.Station
              nl.tudelft.simulation.dsol.formalisms.flow.Generator

All Implemented Interfaces:
  nl.tudelft.simulation.event.EventProducerInterface, java.io.Serializable, StationInterface

Direct Known Subclasses:
  Schedule

public class Generator
extends Station

This class defines a generator
(c) copyright 2003 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

Version:
  2.0 21.09.2003
Author:
  Peter Jacobs , Alexander Verbraeck
See Also:
  Serialized Form

Field Summary
`protected nl.tudelft.simulation.language.reflection.SerializableConstructor` | `constructor` constructor refers to the constructor to be invoked
`protected java.lang.Object[]` | `constructorArguments` constructorArguments refer to the arguments invoked by the
`static nl.tudelft.simulation.event.EventType` | `CREATE_EVENT` CREATE_EVENT is fired on creation
`protected nl.tudelft.simulation.jstats.distributions.DistContinuous` | `interval` interval defines the inter construction time
`protected SimEvent` | `nextEvent` nextEvent refers to the next simEvent
`protected nl.tudelft.simulation.jstats.distributions.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, java.lang.Class myClass, java.lang.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(java.lang.Object[] constructorArguments)` generates a new entity
`nl.tudelft.simulation.jstats.distributions.DistDiscrete` | `getBatchSize()` returns the batchSize
`nl.tudelft.simulation.jstats.distributions.DistContinuous` | `getInterval()` returns the interarrival intercal
`long` | `getMaxNumber()` returns the maximum number of entities to be created
`nl.tudelft.simulation.jstats.distributions.DistContinuous` | `getStartTime()` returns the startTime of the generator
`void` | `receiveObject(java.lang.Object object)` receives an object is invoked whenever an entity arrives
`void` | `setBatchSize(nl.tudelft.simulation.jstats.distributions.DistDiscrete batchSize)` sets the batchsize of the generator
`void` | `setInterval(nl.tudelft.simulation.jstats.distributions.DistContinuous interval)` sets the interarrival distribution
`void` | `setMaxNumber(long maxNumber)` sets the maximum number of entities to be created
`void` | `setStartTime(nl.tudelft.simulation.jstats.distributions.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

### CREATE_EVENT

    public static final nl.tudelft.simulation.event.EventType CREATE_EVENT

  CREATE_EVENT is fired on creation

### constructorArguments

    protected java.lang.Object[] constructorArguments

  constructorArguments refer to the arguments invoked by the

### interval

    protected nl.tudelft.simulation.jstats.distributions.DistContinuous interval

  interval defines the inter construction time

### startTime

    protected nl.tudelft.simulation.jstats.distributions.DistContinuous startTime

  startTime defines the absolute startTime for the generator

### constructor

    protected nl.tudelft.simulation.language.reflection.SerializableConstructor constructor

  constructor refers to the constructor to be invoked

### nextEvent

    protected SimEvent nextEvent

  nextEvent refers to the next simEvent

Constructor Detail

### Generator

    public Generator(DEVSSimulatorInterface simulator,
                     java.lang.Class myClass,
                     java.lang.Object[] constructorArguments)
              throws SimRuntimeException

  constructs a new generator for objects in a simulation. Constructed objects are sent to the 'destination' of the Generator when a destination has been indicated with the setDestination method. This constructor has a maximum number of entities generated, which results in stopping the generator when the maximum number of entities has been reached.

Parameters:
  `simulator` - is the on which the construction of the objects must be scheduled.
  `myClass` - is the class of which entities are created
  `constructorArguments` - are the parameters for the constructor of myClass. of arguments. `constructorArgument[n]=new Integer(12)` may have constructorArgumentClasses[n]=int.class;
Throws:
  `SimRuntimeException` - on constructor invokation.

Method Detail

### generate

    public void generate()
                  throws SimRuntimeException

  generates a new entity with the basic constructorArguments

  Throws:
    `SimRuntimeException` - on construction failure

### generate

    public void generate(java.lang.Object[] constructorArguments)
                  throws SimRuntimeException

  generates a new entity

  Parameters:
    `constructorArguments` - are the parameters used in the constructor.
  Throws:
    `SimRuntimeException` - on construction failure

### receiveObject

    public void receiveObject(java.lang.Object object)

  Description copied from interface: `StationInterface`
  receives an object is invoked whenever an entity arrives

  Specified by:
    `receiveObject` in interface `StationInterface`
  Overrides:
    `receiveObject` in class `Station`
  See Also:
    `StationInterface.receiveObject(Object)`

### getBatchSize

    public nl.tudelft.simulation.jstats.distributions.DistDiscrete getBatchSize()

  returns the batchSize

  Returns:
    DistDiscrete

### getInterval

    public nl.tudelft.simulation.jstats.distributions.DistContinuous getInterval()

  returns the interarrival intercal

  Returns:
    DistContinuous

### getMaxNumber

    public long getMaxNumber()

  returns the maximum number of entities to be created

  Returns:
    long the maxNumber

### setBatchSize

    public void setBatchSize(nl.tudelft.simulation.jstats.distributions.DistDiscrete batchSize)

  sets the batchsize of the generator

  Parameters:
    `batchSize` - is the number of entities simultaniously constructed

### setInterval

    public void setInterval(nl.tudelft.simulation.jstats.distributions.DistContinuous interval)

  sets the interarrival distribution

  Parameters:
    `interval` - is the interarrival time

### setMaxNumber

    public void setMaxNumber(long maxNumber)

  sets the maximum number of entities to be created

  Parameters:
    `maxNumber` - is the maxNumber

### getStartTime

    public nl.tudelft.simulation.jstats.distributions.DistContinuous getStartTime()

  returns the startTime of the generator

  Returns:
    DistContinuous

### setStartTime

    public void setStartTime(nl.tudelft.simulation.jstats.distributions.DistContinuous startTime)

  sets the startTime

  Parameters:
    `startTime` - is the absolute startTime

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2004 Delft University of Technology, the Netherlands. All Rights Reserved.