Narrowcast Plot Example

No preview image

1 collaborator

Uri_dolphin3 Uri Wilensky (Author)

Tags

(This model has yet to be categorized with any tags)
Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 4.0pre8 • Viewed 158 times • Downloaded 24 times • Run 0 times
Download the 'Narrowcast Plot Example' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


VERSION

$Id: Narrowcast Plot Example.nlogo 37529 2008-01-03 20:38:02Z craig $

Simple demo of narrowcast plotting, plotting where each

HubNet client has its own version of a plot.

1. press GO

2. let clients log in

3. click drawplot to draw a different random plot in each client

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

turtles-own [ user-id ]

to startup
  setup
  hubnet-set-client-interface "COMPUTER" []
  hubnet-reset
end 

to setup
  ca
  ;; makes plot1
  __hubnet-make-plot-narrowcast "plot1"
end 
;; draws a random plot on the client of a turtle

to drawplot ;; turtle procedure
  __hubnet-clear-plot user-id
  __hubnet-plot-pen-down user-id
  repeat 10 [
    __hubnet-plot-point user-id random 10 random 10
  ]
end 

to go
  ;; let clients log in or out
  if hubnet-message-waiting?
  [
    hubnet-fetch-message
    ifelse hubnet-enter-message?
    [
      ask turtles with [ user-id = hubnet-message-source ]
      [ die ]
      crt 1
      [
        setxy random-float world-width random-float world-width
        set user-id hubnet-message-source
        hubnet-send user-id "who" who
      ]
    ]
    [
      if hubnet-exit-message?
      [
        ask turtles with [ user-id = hubnet-message-source ]
        [ die ]
      ]
    ]
  ]
end 

There are 2 versions of this model.

Uploaded by When Description Download
Uri Wilensky over 14 years ago Narrowcast Plot Example Download this version
Uri Wilensky over 14 years ago Narrowcast Plot Example Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.