The environment classis the class responsible for read a file containing
inputs labelled bytimeand deliver them to the correct system sensor at
the right time. It also collects the (re)actions from the systemand
provides functionality to enable the inspection of them.
\begin{vdm_al} class Environment issubclassof GLOBAL
types public InputTP = (Time * seqof Inpline) inv inp == forall line insetelems inp.#2 & inp.#1 >= line.#4;
public Inpline = (Sense * Chamber * ActivityData * Time);
-- Amount of time we want to simulate
simtime : Time;
\end{vdm_al}
Then we define the sensors attachment place where the physician will screw the leads and where the accelerometer isset up.
\begin{vdm_al} instancevariables -- Sensors
-- Leads
leads : map Chamber to Lead := {|->};
-- Accelerometer
accelerometer : Accelerometer;
\end{vdm_al}
The environment constructor reads the test file which name is provided in the variable fname, extracting the amount oftime we want to simulate and the inputs in that amount oftime.