io.sarl.api.core
Capacity Time
All Superinterfaces:
Capacity
All Known Implementing Classes:
TimeSkill
capacity Time
implements Capacity
Gives access to the time in the agent application. Time management is application-dependent. This capacity does not make any assumption on neither time evolution nor time refresh rate.
Property Summary
Modifier and type Property and description
double oSTimeFactor
Replies the scaling factor between the agent time and the operating system time.
Action Summary
Modifier and type Action and description
abstract double fromOSDuration(double)
Convert the given duration from the operating system time scale to the time scale of this builtin capacity.
abstract double fromOSTime(double)
Convert the given time from the operating system time scale to the time scale of this builtin capacity.
abstract double getOSTimeFactor
Replies the scaling factor between the agent time and the operating system time.
abstract double getTime([TimeUnit])
Replies the current time.
abstract double toOSDuration(double)
Convert the given duration from the time scale of this builtin capacity to the operating system time scale.
abstract double toOSTime(double)
Convert the given time from the time scale of this builtin capacity to the operating system time scale.
Property Details
oSTimeFactor
val oSTimeFactor : double
Replies the scaling factor between the agent time and the operating system time.

Consider time in the agent application. It may evolves at a different rate than the operating system time. The value that is replied by this function permits to determine the proportionally between the agent application time and the operating system time. A typical equation for representing this relation is: os time = OSTimeFactor * agent time.

This property is an alias for the action: getOSTimeFactor

Returns:
the factor between agent time and operating system time.
Action Details
fromOSDuration(double)
def fromOSDuration(double) : double
Convert the given duration from the operating system time scale to the time scale of this builtin capacity. It means that the operating system milliseconds are converted to "SRE" milliseconds.
Parameters:
timeDuration - the value to convert.
Returns:
the number of milleseconds in the SRE that correspond to the given number in the OS.
Since:
0.9
fromOSTime(double)
def fromOSTime(double) : double
Convert the given time from the operating system time scale to the time scale of this builtin capacity. It means that the operating system milliseconds are converted to "SRE" milliseconds.
Parameters:
timeValue - the value to convert.
Returns:
the number of milleseconds in the SRE that correspond to the given number in the OS.
Since:
0.9
getOSTimeFactor
def getOSTimeFactor : double
Replies the scaling factor between the agent time and the operating system time.

Consider time in the agent application. It may evolves at a different rate than the operating system time. The value that is replied by this function permits to determine the proportionally between the agent application time and the operating system time. A typical equation for representing this relation is: os time = OSTimeFactor * agent time.
Returns:
the factor between agent time and operating system time.
getTime([TimeUnit])
def getTime([TimeUnit]) : double
Replies the current time.
Parameters:
timeUnit - if present, specifies the time unit of the value to reply. By default is it seconds.
Returns:
the current time.
toOSDuration(double)
def toOSDuration(double) : double
Convert the given duration from the time scale of this builtin capacity to the operating system time scale. It means that the "SRE" milliseconds are converted to operating system milliseconds.
Parameters:
timeDuration - the value to convert.
Returns:
the number of milleseconds in the OS that correspond to the given number in the SRE.
Since:
0.9
toOSTime(double)
def toOSTime(double) : double
Convert the given time from the time scale of this builtin capacity to the operating system time scale. It means that the "SRE" milliseconds are converted to operating system milliseconds.
Parameters:
timeValue - the value to convert.
Returns:
the number of milleseconds in the OS that correspond to the given number in the SRE.
Since:
0.9