public class SimRunControlMessage extends Sim0MQMessage
Copyright (c) 2016-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See Sim0MQ License.
Modifier and Type | Class and Description |
---|---|
static class |
SimRunControlMessage.Builder
Builder for the SimRunControl Message.
|
VERSION
Constructor and Description |
---|
SimRunControlMessage(Object simulationRunId,
Object senderId,
Object receiverId,
long messageId,
Object runTime,
Object warmupTime,
Object offsetTime,
double speed,
int numberReplications,
int numberRandomStreams,
Map<Object,Long> streamMap) |
Modifier and Type | Method and Description |
---|---|
byte[] |
createByteArray()
Create a byte array of the fields.
|
static SimRunControlMessage |
createMessage(Object[] fields,
Object intendedReceiverId)
Build a message from an Object[] that was received.
|
Object[] |
createObjectArray()
Create a Sim0MQ object array of the fields.
|
static String |
getMessageType() |
int |
getNumberRandomStreams() |
int |
getNumberReplications() |
NumberTime |
getOffsetTime() |
NumberDuration |
getRunTime() |
double |
getSpeed() |
Map<Object,Long> |
getStreamMap() |
NumberDuration |
getWarmupTime() |
check, getMessageId, getMessageStatus, getMessageTypeId, getReceiverId, getSenderId, getSimulationRunId
public SimRunControlMessage(Object simulationRunId, Object senderId, Object receiverId, long messageId, Object runTime, Object warmupTime, Object offsetTime, double speed, int numberReplications, int numberRandomStreams, Map<Object,Long> streamMap) throws Sim0MQException, NullPointerException
simulationRunId
- the Simulation run ids can be provided in different types. Examples are two 64-bit longs
indicating a UUID, or a String with a UUID number, a String with meaningful identification, or a short or an
int with a simulation run number.senderId
- The sender id can be used to send back a message to the sender at some later time.receiverId
- The receiver id can be used to check whether the message is meant for us, or should be discarded (or an
error can be sent if we receive a message not meant for us).messageId
- The unique message number is meant to confirm with a callback that the message has been received
correctly. The number is unique for the sender, so not globally within the federation.runTime
- Duration of the run of a single replication, including the warmup time, if present. The type is any
numeric type (1-5) or Float or Double with Unit (25, 26) of type Duration (25).warmupTime
- Warmup time of the model in time units that the model uses. The type is any numeric type (1-5) or Float
or Double with Unit (25, 26) of type Duration (25).offsetTime
- Offset of the time (e.g., a model time of 0 is the year 2016, or 1-1-2015). The type is any numeric
type (1-5) or Float or Double with Unit (25, 26) of type Time (26).speed
- Speed as the number of times real-time the model should run; Double.INFINITY means as fast as possible.numberReplications
- Number of replications for stochastic uncertainties in the model.numberRandomStreams
- Number of random streams that follow.streamMap
- Random streams and seeds.Sim0MQException
- on unknown data typeNullPointerException
- when one of the parameters is nullpublic final NumberDuration getRunTime()
public final NumberDuration getWarmupTime()
public final NumberTime getOffsetTime()
public final double getSpeed()
public final int getNumberReplications()
public final int getNumberRandomStreams()
public static final String getMessageType()
public Object[] createObjectArray()
createObjectArray
in class Sim0MQMessage
public byte[] createByteArray() throws Sim0MQException, org.djutils.serialization.SerializationException
createByteArray
in class Sim0MQMessage
Sim0MQException
- on unknown data type as part of the contentorg.djutils.serialization.SerializationException
- when the byte array cannot be created, e.g. because the number of bytes does not matchpublic static SimRunControlMessage createMessage(Object[] fields, Object intendedReceiverId) throws Sim0MQException
fields
- Object[]; the fields in the messageintendedReceiverId
- id of the intended receiverSim0MQException
- when number of fields is not correctCopyright © 2016–2019 Delft University of Technology. All rights reserved.