Copyright | (c) Jesper Kuiper 2021 Leander van Boven 2021 Ramon Meffert 2021 |
---|---|
License | BSD3 |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type Agent = LNode Char
- type AgentId = Int
- type AgentName = Char
- type Call = (Agent, Agent)
- type GroupCall = (Agent, [Agent])
- (☎) :: Agent -> Agent -> Call
- toCalls :: GroupCall -> [Call]
- showAgent :: Agent -> String
- printCall :: Call -> IO ()
- printCalls :: [Call] -> IO ()
- printMakeCall :: Call -> IO ()
- printGroupCall :: GroupCall -> IO ()
- printGroupCalls :: [GroupCall] -> IO ()
- printMakeGroupCall :: GroupCall -> IO ()
- printNoCalls :: IO ()
- printAllCalls :: ([Call], [GroupCall]) -> IO ()
Type definitions
Agents
type Agent = LNode Char Source #
The type of an agent. Agents are always defined in terms of a character and a corresponding (unique) identifying integer.
Calls
type Call = (Agent, Agent) Source #
A call between two agents, defined as (fromcaller, tocallee). A call is considered to be bidirectional, i.e. information flows from the caller to the callee and vice versa.
type GroupCall = (Agent, [Agent]) Source #
A call between a group of agents. The first item in the tuple is the caller, they need to have the phone number of all callees in the list. A group call is also omnidirectional, i.e. the all agent information is pooled and distributed to all agents in the call.
Call generation
toCalls :: GroupCall -> [Call] Source #
Converts a group call to a list of direct calls. This results in an identical flow of information.
Showables and printables
Agents
Calls
printCalls :: [Call] -> IO () Source #
Prints a list of calls.
printMakeCall :: Call -> IO () Source #
Prints a message that a call is made between two agents.
Group calls
printGroupCall :: GroupCall -> IO () Source #
Prints a group call.
printGroupCalls :: [GroupCall] -> IO () Source #
Prints a list of group calls.
printMakeGroupCall :: GroupCall -> IO () Source #
Prints a message that a group call is made.
General
printNoCalls :: IO () Source #
Prints a message that no calls are available.