GbCC 3.0 Dictionary

NetLogo GbCC 3.0 Dictionary

Overview

GbCC (Group-based Cloud Computing) applications allow users to enter a room where everyone accesses their own instance of a particular NetLogo model. Everyone can share data about their model, in a gallery space.

GbCC Primitives and Commands

Manage Data
gbcc:set gbcc:get gbcc:get-from-user gbcc:store-globals gbcc:restore-globals gbcc:restore-globals-from-user gbcc:store-state gbcc:restore-state gbcc:restore-state-from-user

Broadcast to Gallery
gbcc:broadcast-view gbcc:broadcast-text gbcc:broadcast-plot gbcc:broadcast-avatar gbcc:clear-broadcast gbcc:clear-broadcasts

Messages
gbcc:send gbcc:broadcast

Patches
gbcc:show-patches gbcc:hide-patches

Canvases
gbcc:adopt-canvas gbcc:mute-canvas gbcc:unmute-canvas gbcc:get-canvas-list gbcc:get-vacant-indices

Users
gbcc:who-am-i gbcc:my-role gbcc:get-user-list gbcc:get-active-user-list

File Storage
gbcc:import-our-data gbcc:export-our-data gbcc:import-our-data-file gbcc:import-my-data gbcc:export-my-data gbcc:import-my-data-file

GbCC Reserved Procedures

gbcc-on-enter gbcc-on-exit gbcc-on-select gbcc-on-deselect gbcc-on-go gbcc-on-message gbcc-on-mousedown gbcc-on-mouseup

GbCC Primitives and Commands

gbcc:set

Observer Command Observer Command Observer Command

gbcc:set key value

Stores a value, which is accessible by it's key.

gbcc:set "code" "fd 3"
      

gbcc:get

Observer Command Observer Command Observer Command

gbcc:get key

Returns a value, based on it's key.

show gbcc:get "code"
      

gbcc:get-from-user

Observer Command Observer Command Observer Command

gbcc:get-from-user user-id key

Returns a value, based on it's user-id and key.

to gbcc-on-select [user-id]
  show gbcc:get-from-user user-id "code"
end
      

gbcc:store-globals

Observer Command

gbcc:store-globals

Stores all global values.

gbcc:store-globals
      

gbcc:restore-globals

Observer Command

gbcc:restore-globals

Gets stored values and assigns them to their corresponding global variables.

gbcc:restore-globals
      

gbcc:restore-globals-from-user

Observer Command

gbcc:restore-globals-from-user user-id

Gets stored values, based on user-id, and assigns them to their corresponding global variables.*** new ***

to gbcc-on-select [user-id]
  gbcc:restore-globals-from-user user-id
end
      

gbcc:store-state"/a>

Observer Command

gbcc:store-state

Stores users own state, (including state of NetLogo model and GbCC extensions).*** new ***

gbcc:store-state
      

gbcc:restore-state"/a>

Observer Command

gbcc:restore-state

Restores users own previously stored state (including state of NetLogo model and GbCC extensions).*** new ***

gbcc:restore-state
      

gbcc:restore-state-from-user

Observer Command

gbcc:restore-state-from-user user-id

Gets stored state, based on user-id, and load state.

to gbcc-on-select [user-id]
  gbcc:restore-state-from-user user-id
end
      

gbcc:broadcast-view

Observer Command Observer Command Observer Command

gbcc:broadcast-view name

Sends data to the user's canvas, in the gallery. This data is displayed in everyone's gallery. User can send a screenshot of the view.

  gbcc:broadcast-view "my-view"
      

gbcc:broadcast-text

Observer Command Observer Command Observer Command

gbcc:broadcast-text tag message

Sends data to the user's canvas, in the gallery. This data is displayed in everyone's gallery. User can send text.

  gbcc:broadcast-text "some-tag" "my-message"
      

gbcc:broadcast-to-plot

Observer Command Observer Command Observer Command

gbcc:broadcast-plot name

Sends data to the user's canvas, in the gallery. This data is displayed in everyone's gallery. User can send a screenshot a plot.

  gbcc:broadcast-plot "my-plot-name"
      

gbcc:broadcast-avatar

Observer Command Observer Command Observer Command

gbcc:broadcast-avatar shape color text

Sends data to the user's canvas, in the gallery. This data is displayed in everyone's gallery. User can send a turtle shape, an integer representing a color and text that can appear below the shape.

  gbcc:broadcast-avatar "star" 15 "my-name"
      

gbcc:clear-broadcast

Observer Command Observer Command Observer Command

gbcc:clear-broadcast name

Remove specific canvas data from the user's canvas, in the gallery. Data is cleared in everyone's gallery.*** new ***

  gbcc:clear-broadcast "my-plot-name"
      

gbcc:clear-broadcasts

Observer Command Observer Command Observer Command

gbcc:clear-broadcasts

Remove all canvas data from the user's canvas, in the gallery. Data is cleared in everyone's gallery.*** new ***

  gbcc:clear-broadcasts
      

gbcc:who-am-i

Observer Command Observer Command Observer Command

gbcc:who-am-i

Returns a user's user-id.

show gbcc:who-am-i
      

gbcc:my-role

Observer Command Observer Command Observer Command

gbcc:my-role

Returns a user's role, either teacher or student.

show gbcc:my-role
      

gbcc:get-user-list

Observer Command Observer Command Observer Command

gbcc:get-user-list

Returns a list of any users who have ever existed in the session.*** new ***

show gbcc:get-user-list
      

gbcc:get-active-user-list

Observer Command Observer Command Observer Command

gbcc:get-active-user-list

Returns a list of any users who are currently in the session.*** new ***

show gbcc:get-active-user-list
      

gbcc:show-patches

Observer Command Observer Command Observer Command

gbcc:show-patches

Patches are visible.

gbcc:show-patches
      

gbcc:hide-patches

Observer Command Observer Command Observer Command

gbcc:hide-patches

Each patch becomes white. Useful when adjusting opacity when viewing a graph or map.

gbcc:hide-patches
      

gbcc:send

Observer Command Observer Command Observer Command

gbcc:send user-id message-tag message

Send a user a message tag and a message. *** new ***

    gbcc:send user-id "animal" "cat"
      

gbcc:broadcast

Observer Command Observer Command Observer Command

gbcc:broadcast message-tag message

Send all users a message tag and a message. *** new ***

    gbcc:broadcast "animal" "cat"
      

gbcc:adopt-canvas

Observer Command Observer Command Observer Command

gbcc:adopt-canvas user-id canvas-id

Allow a user to take over a canvas.*** new ***

    gbcc:adopt-canvas user-id 3
      

gbcc:mute-canvas

Observer Command Observer Command Observer Command

gbcc:mute-canvas canvas-id

Allow a teacher to mute a canvas. *** new ***

    gbcc:mute-canvas 3
      

gbcc:unmute-canvas

Observer Command Observer Command Observer Command

gbcc:unmute-canvas canvas-id

Allow a teacher to unmute a canvas. *** new ***

    gbcc:unmute-canvas 3
      

gbcc:get-canvas-list

Observer Command Observer Command Observer Command

gbcc:get-canvas-list

Returns a list of user-ids, in canvas order. *** new ***

    show gbcc:get-canvas-list
      

gbcc:get-vacant-indices

Observer Command Observer Command Observer Command

gbcc:get-vacant-indices

Returns a list of unclaimed canvases, by canvas-ids. *** new ***

    gbcc:get-vacant-indices
      

gbcc:import-our-data

Observer Command Observer Command Observer Command

gbcc:import-our-data

A user, with the role of teacher, can import previous data from multiple users. *** new ***

    gbcc:import-our-data
      

gbcc:import-our-data-file

Observer Command Observer Command Observer Command

gbcc:import-our-data-file filename

A user, with the role of teacher, can import previous data from multiple users, from a file saved on the server. *** new ***

    gbcc:import-our-data "our-class-data.txt"
      

gbcc:export-our-data

Observer Command Observer Command Observer Command

gbcc:export-our-data filename

A user can export all data from all users in a session. *** new ***

    gbcc:export-our-data "our-class-data.txt"
      

gbcc:import-my-data

Observer Command Observer Command Observer Command

gbcc:import-my-data

A user can import previous data from a single user. *** new ***

    gbcc:import-my-data
      

gbcc:import-my-data-file

Observer Command Observer Command Observer Command

gbcc:import-my-data-file filename

A user can import previous data from a single user, from a file saved on the server. *** new ***

    gbcc:import-my-data "my-data.txt"
      

gbcc:export-my-data

Observer Command Observer Command Observer Command

gbcc:export-my-data filename

A user can export all data their own user. *** new ***

    gbcc:export-my-data "my-data.txt"
      

GbCC Reserved Procedures

gbcc-on-enter

gbcc-on-enter [ user-id role ] Observer Command

User-defined procedure which, if it exists, will be called when any user first enters the room.

to gbcc-on-enter [ user-id role ]
  show "This is called when a user enters."
  show word user-id " is the unique identifier for this user."
  if (role = "teacher") [ show "User is a teacher." ]
  if (role = "student") [ show "User is a student." ]
end
      

gbcc-on-exit

gbcc-on-exit [ user-id role ] Observer Command

User-defined procedure which, if it exists, will be called when any user exits the room.

to gbcc-on-exit [ user-id role ]
  show "This is called when a user exits."
  show word user-id " is the unique identifier for this user."
  if (role = "teacher") [ show "User is a teacher." ]
  if (role = "student") [ show "User is a student." ]
end
      

gbcc-on-select

gbcc-on-select [ user-id role ] Observer Command

User-defined procedure which, if it exists, will be called when a user selects a canvas in the gallery.

to gbcc-on-select [ user-id role ]
  show "This is called when a user's canvas is selected."
  show word user-id " is the unique identifier for this user."
  if (role = "teacher") [ show "User is a teacher." ]
  if (role = "student") [ show "User is a student." ]
end
      

gbcc-on-deselect

gbcc-on-deselect [ user-id role ] Observer Command

User-defined procedure which, if it exists, will be called when a user deselects a canvas in the gallery.

to gbcc-on-deselect [ user-id role ]
  show "This is called when a user's canvas is deselected."
  show word user-id " is the unique identifier for this user."
  if (role = "teacher") [ show "User is a teacher." ]
  if (role = "student") [ show "User is a student." ]
end
      

gbcc-on-go

gbcc-on-go [ user-id role ] Observer Command

User-defined procedure which, if it exists, will be called when a user selects a canvas in the gallery, by clicking on it's forever icon. This procedure will be called, continuously, until the canvas is deselected.

;; runs continuously
to gbcc-on-go [ user-id role ]
  show "This is called when a user's canvas is selected using it's forever button."
  show word user-id " is the unique identifier for this user."
  if (role = "teacher") [ show "User is a teacher." ]
  if (role = "student") [ show "User is a student." ]
end
      

gbcc-on-message

gbcc-on-message [ user-id role key value] Observer Command

User-defined procedure which, if it exists, will be called when a user does gbcc:send or gbcc:broadcast. *** new ***

 
to gbcc-on-message [ user-id role message-tag message ]
  show "This is called when a user is sent something with gbcc:send or gbcc:broadcast."
  show word user-id " is the unique identifier for this user."
  if (role = "teacher") [ show "User is a teacher." ]
  if (role = "student") [ show "User is a student." ]
  show "The message is about " message-tag 
  show "The message is " message
end
      

gbcc-on-mousedown

gbcc-on-mousedown [ patch-x patch-y] Observer Command

User-defined procedure which, if it exists, will be called when a user does mousedown on View. *** new ***

 
to gbcc-on-mousedown [ patch-x patch-y ]
  show "This is called when a user does mousedown on the View."
  show word ("mouse is at (" patch-x ", " patch-y ")"
end
      

gbcc-on-mouseup

gbcc-on-mouseup [ patch-x patch-y] Observer Command

User-defined procedure which, if it exists, will be called when a user does mouseup on View. *** new ***

 
to gbcc-on-mouseup [ patch-x patch-y ]
  show "This is called when a user does mouseup on the View."
  show word ("mouse is at (" patch-x ", " patch-y ")"
end