Intelligent Footballists

Intelligent Footballists preview image

1 collaborator

Default-person Hossein Sabzian (Author)


(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0.1 • Viewed 145 times • Downloaded 8 times • Run 0 times
Download the 'Intelligent Footballists' modelDownload this modelEmbed this model

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

Comments and Questions

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

Click to Run Model

breed [players player]
breed [balls ball]
players-own [rival spaces movable?]
globals [ target speed]

to setup
  resize-world -40 40 -10 10
  ask patches [ set pcolor green ]
  create-balls 1 [ set color white set shape "circle"]
  create-players 2 [ set color red set rival one-of other players set shape "person" set size 3]
  ask player 1 [ setxy 30 0      set movable? false       set spaces patches with [pxcor = 30] ]
  ask player 2 [ setxy -30 0     set movable? false        set spaces patches with [pxcor = -30] ]
  ask ball 0 [ move-to [patch-here] of one-of players ]
  set speed shoot-speed
  set target "nobody"

to go

  ask players [

             if any? balls-on patch-here [

                                          ask balls [face target ]
                                          set movable? false
                                          ask rival [ set movable? true face target]


  ask players with [ movable? ]  [ if patch-here != target [ fd 1]]

  ask balls [ if patch-here != target [fd 1]        ]


to set-target
  set target one-of [spaces] of rival

There is only one version of this model, created 4 months ago by Hossein Sabzian.

Attached files

File Type Description Last updated
Intelligent Footballists.png preview Preview for 'Intelligent Footballists' 4 months ago, by Hossein Sabzian Download

This model does not have any ancestors.

This model does not have any descendants.