Portability | portable |
---|---|
Stability | experimental |
Maintainer | amy@nualeargais.ie |
Safe Haskell | None |
TODO: fill in
- type AgentProgram c l d n x a = a -> StateT (Universe c l d n x a) IO a
- type AgentsProgram c l d n x a = [a] -> StateT (Universe c l d n x a) IO [a]
- withAgent :: (Clock c, Logger l, Database d, Agent a, Serialize a, Record a, a ~ DBRecord d) => AgentProgram c l d n x a -> AgentId -> StateT (Universe c l d n x a) IO ()
- withAgents :: (Clock c, Logger l, Database d, Agent a, Serialize a, Record a, a ~ DBRecord d) => AgentsProgram c l d n x a -> [AgentId] -> StateT (Universe c l d n x a) IO ()
- runNoninteractingAgents :: (Clock c, Logger l, Database d, Agent a, Serialize a, Record a, a ~ DBRecord d) => AgentProgram c l d n x a -> StateT (Universe c l d n x a) IO ()
- runInteractingAgents :: (Clock c, Logger l, Database d, Agent a, Serialize a, Record a, a ~ DBRecord d) => AgentsProgram c l d n x a -> StateT (Universe c l d n x a) IO ()
- simpleDaemon :: Logger u => Daemon u
- startupHandler :: Logger u => u -> IO u
- shutdownHandler :: Logger u => u -> IO ()
- exceptionHandler :: Logger u => u -> SomeException -> IO u
Documentation
type AgentProgram c l d n x a = a -> StateT (Universe c l d n x a) IO aSource
A program for an agent which doesn't interact with other agents. The input parameter is the agent whose turn it is to use the CPU. The program must return the agent (which may have been modified). (The universe will then be updated with these changes.)
type AgentsProgram c l d n x a = [a] -> StateT (Universe c l d n x a) IO [a]Source
A program which allows an agent to interact with one or more of its neighbours.
The input parameter is a list of agents. The first agent in the list is the agent whose turn it is to use the CPU. The rest of the list contains agents it could interact with. For example, if agents reproduce sexually, the program might check if the first agent in the list is female, and the second one is male, and if so, mate them to produce offspring. The input list is generated in a way that guarantees that every possible sequence of agents has an equal chance of occurring.
The program must return a list of agents that it has modified. (The universe will then be updated with these changes.) The order of the output list is not important.
withAgent :: (Clock c, Logger l, Database d, Agent a, Serialize a, Record a, a ~ DBRecord d) => AgentProgram c l d n x a -> AgentId -> StateT (Universe c l d n x a) IO ()Source
withAgents :: (Clock c, Logger l, Database d, Agent a, Serialize a, Record a, a ~ DBRecord d) => AgentsProgram c l d n x a -> [AgentId] -> StateT (Universe c l d n x a) IO ()Source
runNoninteractingAgents :: (Clock c, Logger l, Database d, Agent a, Serialize a, Record a, a ~ DBRecord d) => AgentProgram c l d n x a -> StateT (Universe c l d n x a) IO ()Source
runInteractingAgents :: (Clock c, Logger l, Database d, Agent a, Serialize a, Record a, a ~ DBRecord d) => AgentsProgram c l d n x a -> StateT (Universe c l d n x a) IO ()Source
simpleDaemon :: Logger u => Daemon uSource
startupHandler :: Logger u => u -> IO uSource
shutdownHandler :: Logger u => u -> IO ()Source
exceptionHandler :: Logger u => u -> SomeException -> IO uSource