vipra-uwf / vipra

1 stars 1 forks source link

VIPRA Behaviors: Targets & Attributes #116

Open GoodenoughR opened 1 year ago

GoodenoughR commented 1 year ago

Currently actions only affect the individual performing the action.

We need a way to specify which object is acted on.

Two new blocks will be added, the Target Selector and Attribute Grabber (names might need to change)

The target selector chooses what will be acted upon, either pedestrians/event/etc.

The Attribute grabber will get attributes from targets. (checks will need to be done in the building phase for proper attribute access)

This will probably be useful in conditions, but exactly how needs to be looked at.

GoodenoughR commented 1 year ago

The new attributes and targets can handle the simple always stop behavior

The grammar needs working and it still needs fixing to cover all current behaviors.

Consider an individual.

Everyone is an individual.

unconditionally, an individual will 
  set velocity to {0}.

output

GoodenoughR commented 1 year ago

Most of the functionality from behaviors has been updated.

In this update I changed the grammar to test out a new format.

Here is the always_stop behavior in the new grammar:

// Declares what types of pedestrians there are
Types:
  individual
.

// Declares a selector
Selector:
  Type: individual
  Select: Everyone
.

// Declares an action for (type), as this has no stimulus it is always active
Action (individual):
  Response: set velocity to {0}
.

always_stop

Here is the important announcement behavior:

// Ped types
Types:
  announcement_listener
.

// selector
Selector:
  Type: announcement_listener
  Select: Everyone
.

// announcement event
Event:
  Name: Announcement
  Start: 5 seconds from !Start
  End: 10 seconds from !Announcement
.

// action, this one has a stimulus that causes the action to take place
Action (announcement_listener):
  Stimulus: !Announcement is occurring
  Response: set velocity to {0}
.

important_announcement

Here is the important announcement behavior with a randomized duration for each pedestrian:

// Ped types
Types:
  announcement_listener
.

// Selector
Selector:
  Type: announcement_listener
  Select: Everyone
.

// Event
Event:
  Name: Announcement
  Start: 5 seconds from !Start
.

// Action, now with a random duration for each pedestrian
Action (announcement_listener):
  Stimulus: !Announcement starting
  Response: set velocity to {0}
  Duration: random 10-20 seconds
.

important_announcement_duration

GoodenoughR commented 1 year ago

Next is adding the ability to target other pedestrians, for both actions and possibly conditions

GoodenoughR commented 11 months ago

pedestrians are able to take actions based on the pedestrians around them, as well as affect those pedestrians.

It is hard to get a good output showing the behaviors as the pedestrians get stuck within 8,000 steps no matter what.