pps

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2021 License: BSD-3-Clause Imports: 4 Imported by: 1

README

Primordial Particle System

An implementation of the Primordial Particle System (PPS) described in:

Schmickl, T., Stefanec, M. & Crailsheim, K. How a life-like system emerges from a simplistic particle motion law. Sci Rep 6, 37969 (2016). https://doi.org/10.1038/srep37969

Explanation video by the authors of the article (not this implementation):

How life emerges from a simple particle motion law: Introducing the Primordial Particle System

Installation

$ go install github.com/fzipp/pps/cmd/pps-simulate@latest

Usage

$ pps-simulate
Visit http://localhost:8080 in a web browser

It uses the following parameter set (as described in the article) by default:

PPS =〈r=5, α=180°, β=17°, v=0.67〉

The parameters, the particle density (DPE) and the size of the universe can be modified via command line flags:

$ pps-simulate -r=4 -alpha=180 -beta=17 -v=0.67 -dpe=0.08 -size=150x150

The port is configurable as well:

$ pps-simulate -http=:6060

Get help about the flags:

$ pps-simulate -help

License

This project is free and open source software licensed under the BSD 3-Clause License.

Documentation

Overview

Package pps is an implementation of the Primordial Particle System (PPS) described in: Schmickl, T., Stefanec, M. & Crailsheim, K. How a life-like system emerges from a simplistic particle motion law. Sci Rep 6, 37969 (2016). https://doi.org/10.1038/srep37969

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParamSet

type ParamSet struct {
	Alpha    float64
	Beta     float64
	Velocity float64
	Radius   float64
}

type Particle

type Particle struct {
	Pos   Vec2
	Angle float64

	Color color.Color
}

func (*Particle) Dir

func (p *Particle) Dir() Vec2

Dir returns the normed direction vector of the particle.

type Universe

type Universe struct {
	Size      Vec2
	ParamSet  ParamSet
	Particles []Particle
	// contains filtered or unexported fields
}

func NewUniverse

func NewUniverse(size Vec2, particleCount int, ps ParamSet) *Universe

func (*Universe) Step

func (u *Universe) Step()

type Vec2

type Vec2 struct {
	X float64
	Y float64
}

A Vec2 represents a vector with coordinates X and Y in 2-dimensional euclidean space.

func (Vec2) String

func (v Vec2) String() string

String returns a string representation of v like "(3.25, -1.5)".

Directories

Path Synopsis
cmd
pps-simulate Module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL