goabm

package module
v0.0.0-...-3af3c62 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2014 License: GPL-3.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

#goabm#

Agent Based Modeling toolkit written in Go

###examples###

An go implementation of Robert Axelrods ABM model of disseminating culture: Axelrod, Robert. "The dissemination of culture a model with local convergence and global polarization." Journal of conflict resolution 41, no. 2 (1997): 203-226.

Documentation

Overview

abst.go is the interface to the abst webinterface

This file is part of GoABM Copyright 2013 by Remo Hertig <remo.hertig@bluewin.ch>

This file is part of GoABM Copyright 2013 by Remo Hertig <remo.hertig@bluewin.ch>

GoABM is a Agent Based Modeling library currently there is only a static 2d grid landscape, see examples/

Index

Constants

This section is empty.

Variables

View Source
var JournaledSimulation bool
View Source
var JournaledSimulationZip bool
View Source
var LogToFile bool
View Source
var OutputDir string
View Source
var RunID string

Functions

func GetAbstPath

func GetAbstPath()

func Init

func Init()

add some flags

func Random

func Random(min, max float64) float64

Types

type Abst

type Abst struct {
	Log        *os.File
	Journal    *os.File
	ZipJournal io.WriteCloser
}

func (*Abst) Close

func (a *Abst) Close()

func (*Abst) Init

func (a *Abst) Init()

type AgentID

type AgentID int

type Agenter

type Agenter interface {
	Act()
	ID() AgentID
}

type FLNMAgent

type FLNMAgent struct {
	*GenericAgent
	X int `json:"x"`
	Y int `json:"y"`
	// contains filtered or unexported fields
}

func (*FLNMAgent) GetRandomNeighbor

func (a *FLNMAgent) GetRandomNeighbor() (AgentID, error)

type FLNMAgenter

type FLNMAgenter interface {
	GetRandomNeighbor() AgentID
}

type FLWMAgent

type FLWMAgent struct {
	*GenericAgent
	Seqnr AgentID `json:"index"`
	X     float64 `json:"x"`
	Y     float64 `json:"y"`

	qt.Handle `json:"-"`
	// contains filtered or unexported fields
}

func (*FLWMAgent) GetRandomNeighbor

func (a *FLWMAgent) GetRandomNeighbor() Agenter

func (*FLWMAgent) Id

func (a *FLWMAgent) Id() AgentID

func (*FLWMAgent) MoveRandomly

func (a *FLWMAgent) MoveRandomly(steplength float64)

type FLWMAgenter

type FLWMAgenter interface {
	GetRandomNeighbor() Agenter
	MoveRandomly(float64)
	Id() AgentID
}

type FixedLandscapeNoMovement

type FixedLandscapeNoMovement struct {
	Agents     []FLNMAgent // library agent object, implements neighbor selection etc.
	UserAgents []Agenter   // agents from the user
	Size       int
	// contains filtered or unexported fields
}

2d landscape with no movement

func (*FixedLandscapeNoMovement) Dump

func (l *FixedLandscapeNoMovement) Dump() NetworkDump

func (*FixedLandscapeNoMovement) GetAgent

func (l *FixedLandscapeNoMovement) GetAgent(x, y int) Agenter

func (*FixedLandscapeNoMovement) GetAgentById

func (l *FixedLandscapeNoMovement) GetAgentById(id AgentID) Agenter

func (*FixedLandscapeNoMovement) GetAgents

func (l *FixedLandscapeNoMovement) GetAgents() *[]Agenter

func (*FixedLandscapeNoMovement) Init

func (l *FixedLandscapeNoMovement) Init(model Modeler)

type FixedLandscapeWithMovement

type FixedLandscapeWithMovement struct {
	Agents     []FLWMAgent // library agent object, implements neighbor selection etc.
	UserAgents []Agenter   // agents from the user
	Size       int
	Sight      float64
	NAgents    int
	// contains filtered or unexported fields
}

2d landscape with movement

func (*FixedLandscapeWithMovement) Dump

func (l *FixedLandscapeWithMovement) Dump() NetworkDump

func (*FixedLandscapeWithMovement) GetAgentById

func (l *FixedLandscapeWithMovement) GetAgentById(id AgentID) Agenter

func (*FixedLandscapeWithMovement) GetAgents

func (l *FixedLandscapeWithMovement) GetAgents() *[]Agenter

func (*FixedLandscapeWithMovement) Init

func (l *FixedLandscapeWithMovement) Init(model Modeler)

type Landscaper

type Landscaper interface {
	Init(Modeler)
	//Action()
	GetAgents() *[]Agenter
	Dump() NetworkDump //TODO: cleanup dump and use streams
	GetAgentById(AgentID) Agenter
	RandomAgent() Agenter
}

type Logger

type Logger struct {
	StdOut   bool
	Model    Modeler
	FirstOut bool
	Out      *os.File
}

func (*Logger) Init

func (l *Logger) Init()

func (*Logger) Step

func (l *Logger) Step(stats Statistics)

type Model

type Model struct {
	Ruleset
	// contains filtered or unexported fields
}

func (*Model) InitRand

func (m *Model) InitRand()

func (*Model) Random

func (m *Model) Random(min, max float64) float64

func (*Model) RollDice

func (m *Model) RollDice(probability float64) bool

type Modeler

type Modeler interface {
	LandscapeAction()
	Init(interface{}) //Landscaper)
	CreateAgent(interface{}) Agenter
	InitRand()
}

type Ruleset

type Ruleset struct {
	Rules map[string]bool
}

func (*Ruleset) Init

func (r *Ruleset) Init()

func (*Ruleset) IsRuleActive

func (r *Ruleset) IsRuleActive(rule string) bool

func (*Ruleset) SetRule

func (r *Ruleset) SetRule(rule string, val bool)

type Simulation

type Simulation struct {
	Features      int
	Traits        int
	Landscape     Landscaper
	Stats         Statistics
	Model         Modeler
	Log           Logger
	AbstInterface Abst
}

func (*Simulation) Init

func (s *Simulation) Init()

func (*Simulation) Step

func (s *Simulation) Step()

func (*Simulation) Stop

func (s *Simulation) Stop()

type Statistics

type Statistics struct {
	Events int
	Steps  int
}

Directories

Path Synopsis
examples
axelrod_moving command
An extension to Robert Axelrods ABM model of disseminating culture [1] [1]: Axelrod, Robert.
An extension to Robert Axelrods ABM model of disseminating culture [1] [1]: Axelrod, Robert.
axelrod_static command
An go implementation of Robert Axelrods ABM model of disseminating culture [1].
An go implementation of Robert Axelrods ABM model of disseminating culture [1].

Jump to

Keyboard shortcuts

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