University of Trento - Trento, 2022
Davide Lusuardi - [email protected]
The scenario proposed implements a smart house composed of two floors, the garage and the garden. The lights are present in each room and for each window there is an electric shutter. A television is present in the living room with some lights dedicated and the garage door is electric. A solar panel installation of 2 kW is present on the roof.
class Person
Representation of a person.
Methods: moveTo()
another room.
class LightDevice
Representation of a light.
Methods: turnOn()
and turnOff()
.
class ShutterDevice
Representation of a shutter.
Methods: goUp()
and goDown()
.
class GarageDoorDevice
Representation of the electric garage door.
Methods: open()
and close()
.
class TelevisionDevice
Representation of the television.
Methods: turnOn()
and turnOff()
.
class SolarPanelDevice
Representation of the solar panels.
Methods: activate()
and deactivate()
.
class PersonDetectionGoal
Goal: keep detecting people in the rooms.
class PersonDetectionIntention
Implementation of the goal PersonDetectionGoal
.
class BrightnessSensingGoal
Goal: keep sensing the light brightness in the rooms.
Implementation of the goal BrightnessSensingGoal
.
class LightControlGoal
Goal: control the main lights of each room: the light is turned on when there is not enough sunlight and there is someone in the room.
class LightControlIntention
Implementation of the goal LightControlGoal
.
class ShutterControlGoal
Goal: control the shutters of each room: each shutter should go up at 7.00 AM and go down at 9.00 PM.
class ShutterControlIntention
Implementation of the goal ShutterControlGoal
.
class GarageDoorControlGoal
Goal: control the garage door: close it at 9.00 PM if open.
Implementation of the goal GarageDoorControlGoal
.
class TelevisionControlGoal
Goal: control the TV and the lights near the TV: turn on the TV in the morning and after dinner.
Implementation of the goal TelevisionControlGoal
.
class SolarPanelMonitorGoal
Goal: monitor the solar panel status.
Implementation of the goal SolarPanelMonitorGoal
.
class EnergyMonitorGoal
Goal: monitor the energy consumption and production.
class EnergyMonitorIntention
Implementation of the goal EnergyMonitorGoal
.
- src/utils/Observable.js: add an id to each observer to be able to have many observers for each key.
- src/utils/Clock.js:
implementation of the methods
getTime()
andgetIncrement()
that permit to obtain a copy of the current time and the time increment of the clock at each time step. - src/bdi/Beliefset.js:
implementation of the method
matchingLiterals(literal_pattern)
that permits to obtain the literals matching the pattern.