node-test-bed-adapter
Version:
An adapter to connect a node.js application to the Test-bed's Common Information Space or Common Simulation Space.
50 lines (49 loc) • 1.6 kB
text/typescript
import { ITimeManagement, TimeState } from 'test-bed-schemas';
/**
* A service to maintain the simulation time and scenario duration.
* When no simulation is running, returns the actual system time.
*/
export declare class TimeService {
private updatedSimTimeAt;
/**
* The date and time the simulationTime was updated as the number of milliseconds
* from the unix epoch, 1 January 1970 00:00:00.000 UTC.
*/
private timestamp;
/**
* The fictive date and time of the simulation / trial as the number of milliseconds
* from the UNIX epoch, 1 January 1970 00:00:00.000 UTC.
*/
private simTime;
/**
* The number of milliseconds from the start of the trial.
*/
private simTimeElapsed;
/**
* Positive number, indicating how fast the simulation / trial time moves with respect
* to the actual time. A value of 0 means a pause, 1 is as fast as real-time.
*/
private simSpeed;
/** The state of the Test-bed Time Service */
private state;
/**
* Set the simulation time.
*
* @param simTime Received time message
*/
setSimTime(tm: ITimeManagement): void;
/**
* Get the simulation time as Date.
*/
get simulationTime(): Date;
/**
* Get elapsed time in msec.
*/
get timeElapsed(): number;
get timeState(): TimeState;
/**
* Positive number, indicating how fast the simulation / trial time moves with respect
* to the actual time. A value of 0 means a pause, 1 is as fast as real-time.
*/
get simulationSpeed(): number;
}