creatur-5.9.30: Framework for artificial life experiments.
Copyright(c) 2012-2021 Amy de Buitléir
LicenseBSD-style
Maintaineramy@nualeargais.ie
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ALife.Creatur.Task

Description

Provides tasks that you can use with a daemon. These tasks handle reading and writing agents, and various other housekeeping chores, which reduces the amount of code you need to write.

It’s also easy to write your own tasks, using these as a guide.)

Synopsis

Documentation

type AgentProgram u = Agent u -> StateT u IO (Agent u) Source #

A program involving one agent. The input parameter is the agent. The program must return the agent (which may have been modified).

type AgentsProgram u = [Agent u] -> StateT u IO [Agent u] Source #

A program involving multiple agents. The input parameter is a list of agents. The program must return a list of agents that have been *modified*. The order of the output list is not important.

withAgent :: (Universe u, Serialize (Agent u)) => AgentProgram u -> AgentId -> StateT u IO () Source #

Run a program involving one agent

doNothing :: Monad m => m () Source #

Can be used as a startupHandler, shutdownHandler, startRoundProgram, or endRoundProgram