Dodger-Interceptor Game

Dodger-Interceptor Game preview image

1 collaborator

Default-person Pieter Fourie (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 7.0.4 • Viewed 166 times • Downloaded 9 times • Run 0 times
Download the 'Dodger-Interceptor Game' modelDownload this modelEmbed this model

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


WHAT IS IT?

This model demonstrates how complex collective behavior can emerge from extremely simple local interaction rules between agents.

Each agent randomly selects two other agents: - one as its attacker - one as its defender

The agent then moves according to one of two behavioral modes:

  • Hide mode: move so that the defender lies between itself and the attacker
  • Intercept mode: move to a position between the attacker and defender

Although each agent follows only a very simple rule using local information, the group as a whole can produce surprisingly rich emergent patterns including clustering, spirals, milling behavior, flocking, chains, and dynamic formations.

The model is inspired by pursuit-evasion systems, collective motion studies, and selfish herd behavior in biology.

HOW IT WORKS

At setup: 1. A number of turtles (agents) are created at random positions. 2. Each turtle randomly chooses: - another turtle as its attacker - a second turtle as its defender

During each simulation step: - In hide mode, each turtle attempts to move to the opposite side of its defender relative to its attacker. - In intercept mode, each turtle moves toward the midpoint between the attacker and defender.

The assignments remain fixed unless the model is modified.

Optional links can be displayed to visualize these relationships: - Red links point from an agent to its attacker - Green links point from an agent to its defender

Since every turtle is simultaneously reacting to moving targets, global patterns emerge dynamically from decentralized local interactions.

HOW TO USE IT

Buttons

setup Clears the world, creates the agents, and assigns attackers and defenders.

go Runs the simulation continuously.

Slider

num-agents Controls the number of agents created during setup.

Larger values often produce denser and more complex emergent behavior.

Chooser

mode

Selects the behavioral rule used by all agents.

Options:

"hide" - agents attempt to place their defender between themselves and their attacker

"intercept" - agents attempt to move between their attacker and defender

Switch

show-links?

Turns relationship links on or off.

Link colors: - Red link = attacker relationship - Green link = defender relationship

These links help visualize the hidden interaction network driving the motion.

THINGS TO NOTICE

  • Even though each agent only follows a very simple rule, large-scale collective patterns emerge.
  • In "hide" mode, agents often form:

    • rotating groups
    • dense clusters
    • milling structures
    • spirals
  • In "intercept" mode, agents may form:

    • pursuit chains
    • moving lattices
    • unstable chases
    • dynamic interception patterns
  • Small changes in initial conditions can lead to very different outcomes.

  • Some agents may become trapped in cyclic pursuit relationships.

  • The visible motion patterns are strongly shaped by the hidden network of attacker-defender assignments.

THINGS TO TRY

  • Increase the number of agents and observe how the behavior changes.
  • Toggle show-links? on and off to compare visible motion with the underlying interaction structure.
  • Compare "hide" and "intercept" modes using the same number of agents.
  • Try very small numbers of agents (3–10) and observe the geometric patterns.
  • Try very large populations and look for flock-like behavior.
  • Modify movement speed (fd 0.3) to see how stability changes.
  • Add randomness or noise to movement directions.
  • Periodically reassign attackers and defenders during the simulation.

EXTENDING THE MODEL

Possible extensions include:

  • Dynamic reassignment of attacker and defender targets
  • Variable movement speeds
  • Limited turning angles or inertia
  • Vision or distance constraints
  • Obstacles or walls
  • Multiple behavioral strategies in the same population
  • Probabilistic behavior switching
  • Energy or fatigue systems
  • Predator-prey asymmetry
  • Local communication between agents
  • Evolutionary adaptation of strategies

Additional analysis tools could include: - clustering metrics - average inter-agent distance - network statistics - entropy or order measures - trajectory visualization

The model could also be extended into: - crowd dynamics - swarm robotics - autonomous interception systems - biological collective motion studies

NETLOGO FEATURES

This model uses several useful NetLogo features:

  • turtles-own variables to store attacker and defender references
  • links to visualize interaction networks
  • facexy for directional movement toward computed target points
  • agentsets and one-of for random assignment of relationships

The model also demonstrates how: - local interaction rules can create emergent global behavior - networks and spatial movement can be combined in NetLogo

Care must be taken not to use variable names such as dx or dy, since these are already built-in NetLogo primitives.

RELATED MODELS

Related NetLogo models include:

  • Flocking
  • Wolf Sheep Predation
  • Pursuit
  • Traffic Basic
  • GasLab models
  • Boids-style collective motion models

Related concepts: - selfish herd theory - cyclic pursuit - swarm intelligence - emergent behavior - multi-agent systems - pursuit-evasion dynamics

CREDITS AND REFERENCES

This model was inspired by classic pursuit-evasion and collective behavior demonstrations often used in artificial life and complexity science.

Related concepts include: - Hamilton, W. D. (1971). Geometry for the selfish herd. - Reynolds, C. W. (1987). Flocks, herds and schools: A distributed behavioral model.

NetLogo: https://ccl.northwestern.edu/netlogo/

MATSim: https://www.matsim.org/

Comments and Questions

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

Click to Run Model

globals []

turtles-own [
  attacker
  defender
]

to setup
  clear-all

  create-turtles num-agents [
    setxy random-xcor random-ycor
    set color blue
    set size 1.5
  ]

  assign-targets

  reset-ticks
end 

to assign-targets
  ask turtles [

    ;; choose two distinct other turtles
    let others other turtles

    set attacker one-of others
    set defender one-of other others with [self != attacker]
  ]

  update-links
end 

to update-links
  clear-links

  if show-links [

    ask turtles [

      ;; red link to attacker
      create-link-with attacker [
        set color red
        set thickness 0.1
      ]

      ;; green link to defender
      create-link-with defender [
        set color green
        set thickness 0.1
      ]
    ]
  ]
end 

to go

  ask turtles [

    if mode = "hide" [
      do-hide
    ]

    if mode = "intercept" [
      do-intercept
    ]
  ]

  tick
end 

to do-hide
  ;; move so defender lies between self and attacker

  let ax [xcor] of attacker
  let ay [ycor] of attacker

  let defx [xcor] of defender
  let defy [ycor] of defender

  ;; target point is opposite side of defender from attacker
  let tx defx + (defx - ax)
  let ty defy + (defy - ay)

  facexy tx ty
  fd 0.3
end 

to do-intercept
  ;; move between attacker and defender

  let ax [xcor] of attacker
  let ay [ycor] of attacker

  let defx [xcor] of defender
  let defy [ycor] of defender

  ;; midpoint
  let tx (ax + defx) / 2
  let ty (ay + defy) / 2

  facexy tx ty
  fd 0.3
end 

There is only one version of this model, created 10 days ago by Pieter Fourie.

Attached files

File Type Description Last updated
Dodger-Interceptor Game.png preview Preview for 'Dodger-Interceptor Game' 10 days ago, by Pieter Fourie Download

This model does not have any ancestors.

This model does not have any descendants.