Skip to content

Python Slime Simulation. Characteristics of Pattern Formation and Evolution in Approximations of Physarum Transport Networks.

License

Notifications You must be signed in to change notification settings

HenBOMB/Py-Slime-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Slime-Simulation

Simple artificial life python program based on this slime simulation paper, using compute shaders to run the simulation.

"Characteristics of Pattern Formation and Evolution in Approximations of Physarum Transport Networks"

preview

Default Configuration

{
    "width" :           930,
    "height":           540,
    "agent_count":      10000,
    "steps_per_frame":  1,
    "spawn_mode":       1,
    "agent_overlapping":true,
    "radial_boundary":  false,
    "border":           0,
    "decay_rate":       0.01,
    "blur_rate":        0.2,
    "species": [
        [ 22.5, 45, 9, 1, 1, [1, 1, 1] ]
    ]
}

What each property does

  • agent_count: The amount of agents to run in the simulation
  • steps_per_frame: The amount of updates to run per frame (fps auto-capped at 60)
  • spawn_mode: How the agents spawn when starting the simulation
    0: Random position and angle
    1: All at the center with a random angle
    2: Random point in a circle with random angle
    3: Random point in a circle with angle towards the center
    4: Random point in a circle rim with angle towards the center
  • agent_overlapping: When false, agents cannot move to a cell where another agent already is
  • radial_boundary: Sets the agents boundary to a circle (height/2)
  • border: Border boundary offset
  • decay_rate: How much to decay the agent trails per frame
  • blur_rate: How much to blur the agent trails per frame
  • species: Array containing all the spieces to simulate. (max 4)
    [0] SA: FL and FR sensor angle from forward position. deg
    [1] RA: Agent rotation angle. deg
    [2] SO: Sensor offset distance. px
    [4] SS: Step size, how far agent moves per step. px
    [3] SW: Sensor width. px
    [5] Color: The color of the species in RGB 0-1 or 0-255.

Examples

a5.json
2022-06-09-04-38-03

a2.json
2022-06-09-05-16-54

a6.json
2022-06-09-05-12-03

food.json, 200 agents find the shortest path between two food sources. (sped up by 300x)
2022-06-09-16-21-18

Used compushady to run the HLSL compute shaders.

About

Python Slime Simulation. Characteristics of Pattern Formation and Evolution in Approximations of Physarum Transport Networks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published