I just saw your email. Sorry for the late reply. Let me try to give you some direction.
You’ve given little detail, but from what you write it seems that you’re interested in modeling activities inside a home. You’re interested in modeling lighting in a room, a refrigerator, and windows that can open (not sure what you mean with window operation).
One way to model this in Brahms is to model a room as a geographical area. In Brahms you can model geography as areadefinitions in a hierarchy and areas as instances:
area MyHome extends Building {}
area MyKitchen extends Room partof MyHome {}
Now you can model the objects in the room:
class Refrigerator BaseClass {
attributes:
public int temperature;
public symbol lightInFridge;
public boolean doorOpen;
…
activities:
primitive_activity TurnLightOn() {
max_duration: 1;
}
workframes: //object workframes react to facts in the world, not to its beliefs
workframe turnLightOn {
when ((current.doorOpen = true)) {
do {
TurnLightOn();
conclude((current.LigtInFridge = on), bc:100, fc:100);
}
}
}
object MyFridge instanceof Refrigerator {
location: MyKitchen; //the fridge is in the kitchen
initial_facts:
(current.LightInFridge = off);
(current.doorOpen = false);
(current.temperature = 3); //degrees Celsius
}
Now you can model an agent in the kitchen open the fridge door and the fridge turn on the light:
agent Habtamu {
location: MyKitchen; //the agent is in the kitchen
activities:
primitive_activity OpenFridgeDoor() {
max_duration: 1;
}
workframes:
workframe OpenTheFridge {
when ((current.location = MyKitchen)) { //when the agent is in the kitchen, which he is (see location), he opens
do { //the fridge
OpenFridgeDoor();
conclude((MyFridge.doorOpen = yes), bc:100, fc:100); // the agent sets the fact that the fridge door is open
} // as well as set the agent’s belief. The fact will trigger
} // the object’s workframe to turn on the light
}
I hope this helps.
Maarten Sierhuis.