public class HlaReporter
extends java.lang.Object
HlaManager
;
- the usage of StringBuffer[] must be removed.Modifier and Type | Field and Description |
---|---|
int |
_numberOfOtherTicks
Represents the number of the ticks that were not considered in the variable
_numberOfTicks |
int |
_numberOfTAGs
Represents the number of time advance grants this federate has received.
|
java.util.ArrayList<java.lang.Integer> |
_numberOfTicks
Array that contains the number of ticks between a NER or TAR and its respective TAG.
|
int |
_numberOfTicks2
Represents the number of call to tick2() made by the federate.
|
java.util.ArrayList<java.lang.Double> |
_TAGDelay
Array that contains the delays between a NER or TAR and its respective TAG.
|
Constructor and Description |
---|
HlaReporter(java.lang.String folderName,
java.lang.String federateName,
java.lang.String federationName,
java.lang.String modelName)
Construct a HLA analysis reporter object instance.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateRuntime()
Calculate the duration of the execution of the federation.
|
java.lang.String |
displayAnalysisValues()
Display some analysis results as string.
|
double |
getTimeOfTheLastAdvanceRequest()
Get the time of the last advance request call.
|
void |
incrNumberOfNERs()
Increment the counter of NERs.
|
void |
incrNumberOfRAVs()
Increment the counter of RAV.
|
void |
incrNumberOfTARs()
Increment the counter of TARs.
|
void |
incrNumberOfUAVs()
Increment the counter of UAV.
|
void |
initializeAttributesSubscribedToVariables(java.util.HashMap<java.lang.String,java.lang.Object[]> hlaAttributesSubscribedTo)
Initialize variables specific to HLA attribute value subscription.
|
void |
initializeAttributesToPublishVariables(java.util.HashMap<java.lang.String,java.lang.Object[]> hlaAttributesToPublish)
Initialize variables specific to HLA attribute value publication.
|
void |
initializeReportVariables(double hlaLookAHead,
double hlaTimeStep,
double hlaTimeUnitValue,
double startTime,
Time stopTime,
java.lang.String federateName,
java.lang.String fedFilePath,
java.lang.Boolean isCreator,
java.lang.Boolean timeStepped,
java.lang.Boolean eventBased)
Initialize all variables used in reports.
|
void |
setTimeOfTheLastAdvanceRequest(long value)
Set the time of the last advance request call.
|
void |
storeTimes(java.lang.String reason,
Time hlaCurrentTime,
Time ptolemyCurrentTime)
This method records the PTII time and the HLA time as Ptolemy's time.
|
void |
updateFolRAVsTimes(Time ravTimeStamp)
This method updates the _folRAVsTimes (StringBuffer) with the RAV's timestamp value.
|
void |
updateRAVsInformation(HlaSubscriber hs,
HlaTimedEvent te,
Time ptTime,
java.util.HashMap<java.lang.String,java.lang.Object[]> hlaAttributesToSubscribeTo,
java.lang.Object value)
This method records in StringBuffer arrays all information about RAVs
during the simulation execution.
|
void |
updateUAVsInformation(HlaPublisher hp,
Token in,
Time hlaTime,
Time ptTime,
int microstep,
certi.rti.impl.CertiLogicalTime uavTimeStamp)
This method records in StringBuffer arrays all information about UAVs
during the simulation execution.
|
void |
writeDelays()
Write a report containing(in a .csv file
_csvFile ), among other informations,
the number of ticks, the delay between a NER or a TAR and its respective TAG, the number of UAVs and RAVs. |
void |
writeNumberOfHLACalls()
Write the number of HLA calls of each federate, along with information about the
time step and the runtime, in a file.
|
void |
writeRAVsInformation()
Write all recorded RAV information to file.
|
void |
writeTimes()
Write all time information to file ('...
|
void |
writeUAVsInformation()
Write all recorded UAV information to file.
|
public int _numberOfTAGs
public java.util.ArrayList<java.lang.Double> _TAGDelay
public int _numberOfTicks2
public java.util.ArrayList<java.lang.Integer> _numberOfTicks
public int _numberOfOtherTicks
_numberOfTicks
public HlaReporter(java.lang.String folderName, java.lang.String federateName, java.lang.String federationName, java.lang.String modelName) throws java.io.IOException
java.io.IOException
- If the target directory cannot be created.public void calculateRuntime()
public java.lang.String displayAnalysisValues()
public void incrNumberOfNERs()
public void incrNumberOfRAVs()
public void incrNumberOfUAVs()
public void incrNumberOfTARs()
public void initializeAttributesToPublishVariables(java.util.HashMap<java.lang.String,java.lang.Object[]> hlaAttributesToPublish) throws IllegalActionException
hlaAttributesToPublish
- the HashMap of HlaPublisher names and instances.IllegalActionException
- If failed to retrieve the HLA actor attribute value name.public void initializeAttributesSubscribedToVariables(java.util.HashMap<java.lang.String,java.lang.Object[]> hlaAttributesSubscribedTo) throws IllegalActionException
hlaAttributesSubscribedTo
- the HashMap of HlaSubcribers names and instances.IllegalActionException
- If failed to retrieve HLA actor attribute value name.public void initializeReportVariables(double hlaLookAHead, double hlaTimeStep, double hlaTimeUnitValue, double startTime, Time stopTime, java.lang.String federateName, java.lang.String fedFilePath, java.lang.Boolean isCreator, java.lang.Boolean timeStepped, java.lang.Boolean eventBased)
public void updateFolRAVsTimes(Time ravTimeStamp)
ravTimeStamp
- The RAV timestamp.public void updateRAVsInformation(HlaSubscriber hs, HlaTimedEvent te, Time ptTime, java.util.HashMap<java.lang.String,java.lang.Object[]> hlaAttributesToSubscribeTo, java.lang.Object value) throws IllegalActionException
hs
- HlaSubscriber actor which has received the RAV.te
- HLA timed event associated to the RAV in Ptolemy's DE domain.hlaAttributesToSubscribeTo
- List of HlaSubscribers.value
- The HLA update attribute value received.IllegalActionException
- If the HlaSubscriber attribute name is not retrieved.
NOTE: this method is responsible of the setup of all variable for the RAVs reporting part.public void updateUAVsInformation(HlaPublisher hp, Token in, Time hlaTime, Time ptTime, int microstep, certi.rti.impl.CertiLogicalTime uavTimeStamp) throws IllegalActionException
hp
- HlaPublisher actor responsible of the UAV.in
- The emitted token.hlaTime
- HLA logical time as Ptolemy's time.ptTime
- PTII time as Ptolemy's time.microstep
- The current DE director's microstep.uavTimeStamp
- The timestamp of the UAV.IllegalActionException
- If the HlaPublisher attribute name is not retrieved.public void setTimeOfTheLastAdvanceRequest(long value)
public double getTimeOfTheLastAdvanceRequest()
public void storeTimes(java.lang.String reason, Time hlaCurrentTime, Time ptolemyCurrentTime)
reason
- Reason to store the time values.hlaCurrentTime
- HLA logical time as Ptolemy's time.directorTime
- PTII time as Ptolemy's time.public void writeDelays()
_csvFile
), among other informations,
the number of ticks, the delay between a NER or a TAR and its respective TAG, the number of UAVs and RAVs.public void writeNumberOfHLACalls()
public void writeRAVsInformation()
public void writeTimes()
public void writeUAVsInformation()