Skip to content
Snippets Groups Projects
Commit 62cdabc8 authored by POLITO Guillermo Andres's avatar POLITO Guillermo Andres
Browse files

Pass on scaladoc of NetworkEntity

parent d1401c12
Branches
No related tags found
No related merge requests found
/** **********************************************************************************************************
* Contributors:
* - created by Pierre Falez on 10/05/16.
* **********************************************************************************************************/
package fr.univ_lille.cristal.emeraude.n2s3.core
import fr.univ_lille.cristal.emeraude.n2s3.core.GlobalTypesAlias.Timestamp
import fr.univ_lille.cristal.emeraude.n2s3.support.actors.Message
class GlobalTimestamp {
var timestamp: Timestamp = 0
}
trait TimestampGenerator {
var currentMaxTimestamp: Timestamp = 0
def getGlobalTimestamp: GlobalTimestamp
def toGlobalTimestamp(rawTimestamp: Timestamp): Timestamp = {
currentMaxTimestamp = math.max(rawTimestamp, currentMaxTimestamp)
getGlobalTimestamp.timestamp + rawTimestamp
}
def endOfStage(): Unit = {
getGlobalTimestamp.timestamp += currentMaxTimestamp
currentMaxTimestamp = 0
}
}
\ No newline at end of file
......@@ -28,7 +28,7 @@ object NetworkEntity {
}
/**
* Represent entity which can be designated by a reference
* A trait with common behaviour for entities in a N2S3 simulation.
*/
trait NetworkEntity {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment