GbCC (Group-based Cloud Computing) applications allow users to enter a room where everyone accesses
their own instance of a particular NetLogo model, or participate in a group NetLogo model.
Everyone can share data, in a gallery space.
The first user who enters the room has the role of teacher.
Any user who enter a room after a teacher has the role of student.
User Event Listeners
When certain events occur, then Reserved Procedures are called.
Models do not require Reserved Procedures.
Reserved Procedures include two arguments: a user-id (unique identifier for a user) and role (either "teacher" or "student").
User Enters Room
to gbcc-on-enter [ user-id role ] ;; user-id identifies who entered ;; role is either teacher or student" end
User Exits Room
to gbcc-on-exit [ user-id role ] ;; user-id identifies who exited ;; role is either teacher or student" end
Who Am I and My Role
show gbcc:who-am-i ;; returns your user's user-id
show gbcc:my-role ;; returns your user's role (student or teacher)
Share to Gallery
Broadcast View to Gallery
gbcc:broadcast-view "My View"
Broadcast Plot to Gallery
gbcc:broadcast-plot "Plot Number of Turtles"
Broadcast Text to Gallery
gbcc:broadcast-text "animal" "cat"
Broadcast Avatar to Gallery
gbcc:broadcast-avatar "star" 45 "my-name""
Clear Broadcasts in Gallery
gbcc:clear-broadcast
Gallery Event Listeners
Select Canvas
to gbcc-on-select [ user-id role ] ;; user-id identifies whose canvas was selected ;; role is either teacher or student" end
Deselect Canvas
to gbcc-on-deselect [ user-id role ] ;; user-id identifies whose canvas was deselected ;; role is either teacher or student" end
Forever Select Canvas
to gbcc-on-go [ user-id role ] ;; user-id identifies whose canvas was forever selected ;; role is either teacher or student" end
Gallery Features
Scroll through Layers on a Canvas
Listen or Ignore Broadcasts to Gallery
Users can listen for updates to the gallery, or they can ignore updates.
Note: It is not possible to "ignore" when any canvas forever buttons are on.
Saving and Retrieving Data - Discrete
Set
gbcc:set "code" "fd 2"
Get
show gbcc:get "code"
Get From User
to gbcc-on-select [ user-id role ] show gbcc:get-from-user "code" end
Store
gbcc:store
Restore
gbcc:restore
Restore From User
to gbcc-on-select [ user-id role ] gbcc:restore-from-user "code" end