Class Duplicate<T extends Number & Comparable<T>>
java.lang.Object
org.djutils.event.LocalEventProducer
nl.tudelft.simulation.dsol.formalisms.flow.FlowObject<T>
nl.tudelft.simulation.dsol.formalisms.flow.Duplicate<T>
- Type Parameters:
T
- the time type
- All Implemented Interfaces:
Serializable
,Remote
,Identifiable
,EventProducer
The Duplicate flow block makes a number of copies of incoming entities and sends them to a destination.
Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Author:
- Peter Jacobs , Alexander Verbraeck
- See Also:
-
Field Summary
Fields inherited from class nl.tudelft.simulation.dsol.formalisms.flow.FlowObject
RECEIVE_EVENT, RELEASE_EVENT
Fields inherited from interface org.djutils.event.EventProducer
FIRST_POSITION, LAST_POSITION
-
Constructor Summary
ConstructorDescriptionDuplicate
(String id, DevsSimulatorInterface<T> simulator, FlowObject<T> duplicateDestination) Create a new Duplicate flow block that makes 1 copy.Duplicate
(String id, DevsSimulatorInterface<T> simulator, FlowObject<T> duplicateDestination, int numberCopies) Create a new Duplicate flock block that makes numberCopies copies. -
Method Summary
Modifier and TypeMethodDescriptionvoid
receiveEntity
(Entity<T> entity) Arrival of a new entity into the flow object.Methods inherited from class nl.tudelft.simulation.dsol.formalisms.flow.FlowObject
getDestination, getId, getSimulator, releaseEntity, setDestination, toString
Methods inherited from class org.djutils.event.LocalEventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventListenerMap, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
Constructor Details
-
Duplicate
public Duplicate(String id, DevsSimulatorInterface<T> simulator, FlowObject<T> duplicateDestination) Create a new Duplicate flow block that makes 1 copy.- Parameters:
id
- String; the id of the FlowObjectsimulator
- DevsSimulatorInterface<T>; on which is scheduledduplicateDestination
- FlowObject<T>; the duplicate destination
-
Duplicate
public Duplicate(String id, DevsSimulatorInterface<T> simulator, FlowObject<T> duplicateDestination, int numberCopies) Create a new Duplicate flock block that makes numberCopies copies.- Parameters:
id
- String; the id of the FlowObjectsimulator
- DevsSimulatorInterface<T>; on which is scheduledduplicateDestination
- FlowObject<T>; which is the duplicate definitionnumberCopies
- int; the number of copies
-
-
Method Details
-
receiveEntity
Arrival of a new entity into the flow object.- Overrides:
receiveEntity
in classFlowObject<T extends Number & Comparable<T>>
- Parameters:
entity
- Entity; the arriving entity
-