Skip to content

Scooter Control & Monitor Domain Model

Class Diagram

UML diagram image

Details

Duration

Constraints:

  • \(milliseconds > 0\)

Speed

Constraints:

  • \(metersPerSecond = kilometersPerHour / 3.6\)
  • \(metersPerSecond \geq 0\)

BatteryLevel

Constraints:

  • \(0 \leq percentage \leq 100\)

Note

If the scooter goes under standby, speed limits imposed by Scooter Control are ignored.

Rules

A scooter has some properties that an employee can set to alter its behavior:

  • desiredMaxSpeed: the maximum speed a scooter can reach at any moment;
  • powerSavingMaxSpeed: the maximum speed a scooter can reach while in power saving mode;
  • powerSavingThreshold: the battery level below which the scooter goes in power saving mode.

The policy of the scooters dictate that, at any moment, the speed of a scooter should be below the desired max speed. Also, while in power saving mode, the scooter must also obey to the powerSavingMaxSpeed rule. Therefore, at any moment the real maximum speed can be calculated as:

  • desiredMaxSpeed, if the scooter is in active mode.
  • min(desiredMaxSpeed, powerSavingMaxSpeed), otherwise.

Furthermore, a scooter can at any moment go in standby mode. This behavior is dictated by the hardware mounted on the scooter itself. The system reacts to the switch by notyfing all services so that polices can be applied.

Domain Events

  • ScooterStatusChanged: emitted after scooter status updates (namely at least one of updateFrequency, locked, maxSpeed or standby).
  • TelemetryUpdate: emitted periodically (and frequently) with scooter telemetry updates (namely the current value of the position, battery and speed properties).

Last update: January 17, 2022 11:43:20
Created: July 1, 2021 10:44:49
Authors: Simone (11.27%), ldeluigi (11.27%), Francesco Dente (77.46%)