Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 111 additions & 119 deletions Pipfile.lock

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions examples/EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Examples

The examples provided are supposed to illustrate the usage of AASM as a language.

## Facebook

The facebook simulations showcase basic functionalities of AASM, namely minimal example of sending and receiving parametrised messages.
Two versions are provided, with and without macro usage.

## Wolfsheep

A more complex simulation, showcasing computational capabilities of AASM, as well as advanced state management.
The simulation has been inspired by the [Wolf Sheep simple](http://www.netlogoweb.org/launch#http://www.netlogoweb.org/assets/modelslib/IABM%20Textbook/chapter%204/Wolf%20Sheep%20Simple%205.nlogo) 5 example from NetLogo.

## More coming soon...

28 changes: 21 additions & 7 deletions examples/facebook.aasm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@ message facebook_post, query
prm photos, float
emessage

agent average_user
agent user
prm friends, list, conn
prm num_seen_photos, float, init, 0

behav initialize, setup
action initialize_friends, modify_self
decl max_friends, float, 0
len max_friends, connections
decl num_friends, float, 0
rand num_friends, int, uniform, 0, max_friends
subs friends, connections, num_friends
eaction
ebehav

behav facebook_activity, cyclic, 30
action post_photos, send_msg, facebook_post, query
decl num_photos, float, 0
Expand All @@ -12,12 +24,14 @@ agent average_user
send friends
eaction
ebehav

behav read_posts, msg_rcv, facebook_post, query
action update_seen_photos, modify_self
add num_seen_photos, rcv.photos
eaction
ebehav
eagent

graph matrix
SCALE 3
DEFNODE average_user, R0110
DEFNODE average_user, R1011
DEFNODE average_user, R1100
DEFNODE average_user, R1000
graph statistical
defg user, 15, dist_exp, 0.1
egraph
145 changes: 0 additions & 145 deletions examples/facebook.py

This file was deleted.

18 changes: 18 additions & 0 deletions examples/facebook_macro.aasm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@ message facebook_post, query
emessage

agent average_user
prm num_seen_photos, float, init, 0
prm friends, list, conn

behav initialize, setup
action initialize_friends, modify_self
decl max_friends, float, 0
len max_friends, connections
decl num_friends, float, 0
rand num_friends, int, uniform, 0, max_friends
subs friends, connections, num_friends
eaction
ebehav

behav facebook_activity, cyclic, 30
action post_photos, send_msg, facebook_post, query
randint, num_photos, 1, 5
Expand All @@ -19,6 +31,12 @@ agent average_user
send friends
eaction
ebehav

behav read_posts, msg_rcv, facebook_post, query
action update_seen_photos, modify_self
add num_seen_photos, rcv.photos
eaction
ebehav
eagent

graph statistical
Expand Down
134 changes: 0 additions & 134 deletions examples/facebook_macro.py

This file was deleted.

Loading