practical example

20 views
Skip to first unread message

Habtamu Tkubet

unread,
Apr 1, 2020, 9:27:59 AM4/1/20
to Brahms Forum
I am studying and trying to do some tutorials on BRAHMS but I faced many problems like how to relate to the engineering practical issues. would you please send to me if you have one simple practical example like room lighting intensity, room fridge; room window operation  etc.

Ejenta Brahms

unread,
Apr 12, 2020, 3:07:33 AM4/12/20
to brahms...@googlegroups.com
Dear Habtamu,

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:

areadef Room extends BaseAreaDef {
   attributes:
      ...
}
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 {
   locationMyKitchen; //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 {
   locationMyKitchen; //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.

On Apr 1, 2020, at 6:27 AM, Habtamu Tkubet <habti...@gmail.com> wrote:

I am studying and trying to do some tutorials on BRAHMS but I faced many problems like how to relate to the engineering practical issues. would you please send to me if you have one simple practical example like room lighting intensity, room fridge; room window operation  etc.

--
You received this message because you are subscribed to the Google Groups "Brahms Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brahms-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brahms-forum/507ef1b3-d7d8-4863-a565-9d8e385dee63%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages