libs/helpers.nls

Helper functions.

Summary
libs/helpers.nlsHelper functions.
check-payoff-resetProcedure to reset short or long time payoffs if <short-time> or <long-time> periods are completed.
get-technology-by-idGives a technology by technology-id.
get-technology-by-nameGives a technology by technology->technology-name.
get-technologies-by-nameGives a list of technologies by their technology->technology-names.
get-agentGives an agent by agent->agent-id.
get-dimensionGives the number of the dimension given by name
get-edge-technology-bannedReports which technologies are (temporarily) banned, allowed or (completely) impossible to use on the calling edge.
get-from-nodeGives from-node of edge
get-to-nodeGives to-node of edge
sort-edgesSort edges by their ID or their predecessor and successor nodes
fppFloating point precision, checks precision for all list elements Fix for known NetLogo floating point precision issue
add-all-but-firstAdds all list elements execpt the first
decrease-count-agents-nodeDecreases the first dimension “capacity” by subtracting the given parameter from short-time-pay-offs
decrease-count-agents-edgeDecreases the first dimension “capacity” by subtracting the given parameter from short-time-pay-offs
increase-count-agents-nodeIncreases the first dimension “capacity” by adding the given parameter to all pay-offs
increase-count-agents-edgeIncrease the first dimension “capacity” by adding the given parameter to all pay-offs
check-first-dimensionChecks if first dimension of given list is set to the given value
check-deathHandles check of death for all objects that can die: nodes, edges, agents, technologies
check-technologies-deathChecks possible death of technologies, due to end of lifetime
check-nodes-deathChecks possible death of nodes, due to end of lifetime
check-edges-deathChecks possible death of edges, due to end of lifetime (or death of a node connected to that edge, see check-nodes-death.)
check-agents-deathChecks possible death of agents due to several reasons: reaching a final node, exceeding limits etc.
reset-agent-technologiesCreates new technology-objects based on the present ones, will be called when hatching agents.
reset-agent-state-variablesSets agent-state-variables to zero values, to be used when hatching agents or in agent setup.
increase-deathsIncreases count of death of respective type if an agent dies.
check-death-by-locationChecks if an agent has reached a final node and should be removed from the simulation
check-death-by-limitChecks if an agent has exceeded one of his long-time-limits and should be removed from simulation.
set-edge-overcrowdedHandle overcrowded status for edges
set-node-overcrowdedHandle overcrowded status for nodes
get-nodeGives a node by node-id.
check-dontcareReplace every occurence of “e” (Euler’s number) in a list by false (is used to encode “don’t care” in input files of SimCo).
calculate-degree-vectorCalculates the degree vector of the calling entity
degreeReport the degree of a value compared to its limits
calculate-degreeCalculate degree for value between lower and upper limit
payoffReports the actual value of respective object (agent, node, edge) for the given dimension and time.
limitsReports the two limits given for a specific dimension, either for short- or long-time, depending on the callers breed!
limitReports the limit (if specified) or false (if limit is set to “don’t care”)
technology-allowed-on?Checks wether a technology is allowed to be used on an infrastructure element.
technology-available?Checks wether the given technology is in the set of agent.agent-technologies-available and still alive
technology-available-by-name?Checks wether the technology, given by its technology.technology-name is in the set of agent.agent-technologies-available
technology-in-use?Checks wether the given technology actually is used by the agent
technology-type-in-use?Checks wether the a technology corresponding to the given technology-type actually is used by the agent
add-technologies-allowedParses edges from origin to all destinations and adds technology->technology-names of that <technlogies> that are allowed on the edge as well as on the respective destination node to the resulting list
get-technologies-allowedGives all allowed technologies on the given element (node or edge)
remove-technologyRemoves a technology from the set of an agent’s agent->agent-technologies-available.
number-of-technologies-bannedGives the number of banned technologies on the given infrastructure element (node or edge)
hatch-agentCreates a duplicate of an agent by calling the function hatch on the agent calling the function and changes the new agent’s agent.agent-id to an id unused until now.
get-technology-typeReturns a technology-type with the same technology-type->technology-type-name as the technology->technology-name of the given technology
get-technology-type-by-nameReturns a technology-type with the same technology-type->technology-type-name as given
calculate-edge-delayCalculates edge-delay by considering edge-values, technology-values and (if present) factors influenced by controlling interventions
calculate-costs-benefitsCalculates costs benefits based on an agent’s action; depends on location (node/edge), <technology-used>, control-factor and technology-dependency
check-technology-dependenciesChecks, wether the technologie’s factor shall be used when calculating costs-benefits
replace-technology-name-in-actionsReplaces the technology in a (set of) actions by its <technology-name>
names-of-technologiesReports the names of all technologies
names-of-technology-typesReports the names of all technology-types
technology-usageReports the number of agents using each of the technologies that are part of the scenario running.
technology-usage-percentageReports the npercentage of turtles using each of the technologies that are part of the scenario running.
technology-usage-per-agentTypeReports the number of turtles of each type who are using each of the technologies that are part of the scenario running.
technology-usage-per-agentType-percentageReports the percentage of turtles of each type who are using each of the technologies that are part of the scenario running.
count-agent-typeCounts agents per agent-type
agent-types-aliveReports the number of agents of each agent-type still alive.
node-condition-idReports true if the the id of the given node is part of the id-list given .
node-condition-typeReports true if the the cost-benefits-value in my-dimension equals my-value.
get-node-condition-type-valueReports the cost-benefits-value of the node given in the dimension given
get-agent-destination-repetitive-value
increase-agent-destinations-repetitive-positionIncreases the actual position of the agent-destinations-repetitive-pointer by 1
create-technologyInstantiates a new technology object based on the technology-type reffered to via my-technology-type-name
count-technology-usageCounts number of ticks each technology was used in previous time within the running simulation.
get-unknown-technologiesReturns those technologies present in the scenario that were never used by the agent and that s/he actually does not own.
get-buyable-technologies
update-pay-offs-nodeUpdates the pay-offs (and degree) for node by adding the given values to pay-offs
update-pay-offs-agentUpdates the pay-off- and degree-vectors for an agent
update-pay-offs-edgeUpdates the pay-offs (and degree) for edge with the given technology factor
update-node-degreeUpdates the degree vectors of the calling node as well as edge-overcrowded?.
update-edge-degreeUpdates the degree vectors of the calling edge as well as edge-overcrowded?.
update-edge-pay-offs-externalUpdates the pay-offs for externals, considering the technology given.
update-node-pay-offs-externalUpdates the pay-offs for externals, considering the technology given.

check-payoff-reset

to check-payoff-reset

Procedure to reset short or long time payoffs if <short-time> or <long-time> periods are completed.

get-technology-by-id

to-report get-technology-by-id [id]

Gives a technology by technology-id.

Parameter

idinteger, id of technology

Returns

<technology>technology with given technology->technology-id

get-technology-by-name

to-report get-technology-by-name [name]

Gives a technology by technology->technology-name.

Parameter

namename of technology

Returns

<technology>technology with given technology->technology-name

get-technologies-by-name

to-report get-technologies-by-name [list-of-technology-names]

Gives a list of technologies by their technology->technology-names.

Parameter

namelist, names of technologies

Returns

listtechnologies with given technology->technology-names

get-agent

to-report get-agent [id]

Gives an agent by agent->agent-id.

Parameter

idinteger, id of agent

Returns

<agent>agent with given agent->agent-id

get-dimension

to-report get-dimension [dimension-name]

Gives the number of the dimension given by name

Parameters

stringdimension-name name of the dimension to be returned

Returns

intposition of name in names-of-dimensions

get-edge-technology-banned

to-report get-edge-technology-banned

Reports which technologies are (temporarily) banned, allowed or (completely) impossible to use on the calling edge.

returns

list”0” indicating technology allowed, -1 technology not usable, 1 technology banned

get-from-node

to-report get-from-node [edge]

Gives from-node of edge

Parameters

<edge>edge to search for

Returns

<node>from-node for edge

get-to-node

to-report get-to-node [edge]

Gives to-node of edge

Parameters

<edge>edge to search for

Returns

<node>to-node for edge

sort-edges

to-report sort-edges [ A B order?]

Sort edges by their ID or their predecessor and successor nodes

Parameters

Afirst edge to be compared
Bsecond edge to be compared
order?bool, true: order by ID, false: order by nodes (predecessor node first, if both edges share the same predecessor node, successor node is used for comparison)

Returns

<edges>-listedges ordered

fpp

to-report fpp [my-content]

Floating point precision, checks precision for all list elements Fix for known NetLogo floating point precision issue

Parameter

my-contentsingle floating point value or (nested) list of floating point values to be checked

Returns

floating point numbers(s)input number(s), shortended to 12 decimal places.

add-all-but-first

to-report add-all-but-first [list-a list-b]

Adds all list elements execpt the first

Parameters

list-afirst list (first element will be preserved)
list-bsecond list (first element will be ignored)

Returns

listlist of summed up element execpt for first element

decrease-count-agents-node

to decrease-count-agents-node [my-count]

Decreases the first dimension “capacity” by subtracting the given parameter from short-time-pay-offs

Parameters

my-countcapacity/dim 0 the agent uses (dependend on technology) on the nodes

decrease-count-agents-edge

to decrease-count-agents-edge [my-count]

Decreases the first dimension “capacity” by subtracting the given parameter from short-time-pay-offs

Parameters

my-countcapacity/dim 0 the agent uses (dependend on technology) on the edge

increase-count-agents-node

to increase-count-agents-node [my-count]

Increases the first dimension “capacity” by adding the given parameter to all pay-offs

Parameters

my-countcapacity/dim 0 the agent uses (dependend on technology) on the edge

increase-count-agents-edge

to increase-count-agents-edge [my-count]

Increase the first dimension “capacity” by adding the given parameter to all pay-offs

Parameters

my-countcapacity/dim 0 the agent uses (dependend on technology) on the edge

check-first-dimension

to-report check-first-dimension [my-list my-value]

Checks if first dimension of given list is set to the given value

Paramters

my-listlist to check first element
my-valuevalue to check for

Returns

booltrue if values match, else false

check-death

to check-death

Handles check of death for all objects that can die: nodes, edges, agents, technologies

check-technologies-death

to check-technologies-death [my-technologies]

Checks possible death of technologies, due to end of lifetime

Parameter

my-technologiesagentset of technologies that shall be checked for death.  Usually, these will be agent->agent-technologies-available, when called by single agents.

check-nodes-death

to check-nodes-death

Checks possible death of nodes, due to end of lifetime

check-edges-death

to check-edges-death

Checks possible death of edges, due to end of lifetime (or death of a node connected to that edge, see check-nodes-death.).

check-agents-death

to check-agents-death

Checks possible death of agents due to several reasons: reaching a final node, exceeding limits etc.  Afterwards, new agents may be generated to substitute those that died.

reset-agent-technologies

to reset-agent-technologies

Creates new technology-objects based on the present ones, will be called when hatching agents.

reset-agent-state-variables

to reset-agent-state-variables

Sets agent-state-variables to zero values, to be used when hatching agents or in agent setup.

increase-deaths

to increase-deaths

Increases count of death of respective type if an agent dies.

check-death-by-location

to-report check-death-by-location

Checks if an agent has reached a final node and should be removed from the simulation

Returns

booltrue in case of reaching a “final node”.

check-death-by-limit

to-report check-death-by-limit

Checks if an agent has exceeded one of his long-time-limits and should be removed from simulation.

Returns

booltrue in case of exceeding at least one long-time-limit

set-edge-overcrowded

to set-edge-overcrowded

Handle overcrowded status for edges

Should be used in an edge environment

set-node-overcrowded

to set-node-overcrowded

Handle overcrowded status for nodes

Should be used in an node environment

get-node

to-report get-node [id]

Gives a node by node-id.

Parameters

idnode->node-id to search for

Returns

<node>with given node->node-id

check-dontcare

to-report check-dontcare [list-to-check]

Replace every occurence of “e” (Euler’s number) in a list by false (is used to encode “don’t care” in input files of SimCo).

Parameters

list-to-checklist of numbers

Returns

listwhere each “e” is replaced by false

calculate-degree-vector

to-report calculate-degree-vector [time]

Calculates the degree vector of the calling entity

Parameters

timethe time horizon for which the degree-vector shall be calculated: “short” or “long”

Returns

vectorof degree-values for all dimensions (shortened using fpp within calculate-degree).

degree

to-report degree [dimension time]

Report the degree of a value compared to its limits

Parameters

dimensionthe dimension for which the degree-value shall be calculated
timethe time horizon that should be used for calculation, “short” or “long” (as limits may differ for the two time-ranges possible)

Returns

floating point numbercalculated degree

calculate-degree

to-report calculate-degree [my-lower-limit my-upper-limit my-value]

Calculate degree for value between lower and upper limit

Parameters

my-lower-limitlower limit
my-upper-limitupper limit
my-valuevalue to calculate degree for

Returns

floating point numberdegree based on given value and limits, shortened using fpp

payoff

to-report get-payoff [dimension time]

Reports the actual value of respective object (agent, node, edge) for the given dimension and time.

Parameters

dimensionint, dimension to report payoff for
timetime scope (“short” or “long”)

Returns

floating point numberpayoff of calling entity (node, edge, or agent) for given dimension and time

limits

to-report limits [dimension time]

Reports the two limits given for a specific dimension, either for short- or long-time, depending on the callers breed!

Parameters

dimensionint, dimension to report limits for
timetime scope to report limits for (“short” or “long”)

Returns

tupel of float and/or boollimits of caller for dimension and time

limit

Reports the limit (if specified) or false (if limit is set to “don’t care”)

Parameters

my-endend of limit zone (“upper” or something else)
my-tuplelimits tuple

technology-allowed-on?

to-report technology-allowed-on? [my-IE my-technology]

Checks wether a technology is allowed to be used on an infrastructure element.

Parameters

my-IEinfrastructure element (node or edge) to check permission for
my-technologytechnology->technology-name of technology to check

Returns

trueif technology is allowed to be used on the given node or edge.
falseotherwise.

technology-available?

to-report technology-available? [my-technology]

Checks wether the given technology is in the set of agent.agent-technologies-available and still alive

Parameters

my-technologytechnology to be checked

Returns

booltrue if technology is avaiblable to the agent

technology-available-by-name?

to-report technology-available-by-name? [my-technology-name]

Checks wether the technology, given by its technology.technology-name is in the set of agent.agent-technologies-available

Parameters

my-technologytechnology.technology-name to be checked

Returns

booltrue if technology is avaiblable to the agent

technology-in-use?

to-report technology-in-use? [my-technology]

Checks wether the given technology actually is used by the agent

Parameters

my-technologytechnology to be checked

Returns

booltrue if technology is in use

technology-type-in-use?

to-report technology-type-in-use? [my-technology-type]

Checks wether the a technology corresponding to the given technology-type actually is used by the agent

Parameters

my-technology-typetechnology-type to be checked

Returns

booltrue if technology is in use

add-technologies-allowed

to-report add-technologies-allowed [my-origin my-destinations]

Parses edges from origin to all destinations and adds technology->technology-names of that <technlogies> that are allowed on the edge as well as on the respective destination node to the resulting list

Parameters

my-originthe node edges should start at.
destinationsa list with nodes to be reached.

Returns

nested ordered listcontaining a node and the <technolog->technology-names> of technologies allowed on edge from my-origin-node to destination-node and destination-node.
empty listif there is no such path.

get-technologies-allowed

to-report get-technologies-allowed [ie]

Gives all allowed technologies on the given element (node or edge)

Parameters

ieinfrastructure-element to use (node or edge)

Returns

list of <technologies>technologies allowed on the given node or edge

remove-technology

to remove-technology [my-technology]

Removes a technology from the set of an agent’s agent->agent-technologies-available.

Parameter

my-technologythe technology to be removed

number-of-technologies-banned

to-report number-of-technologies-banned [ie]

Gives the number of banned technologies on the given infrastructure element (node or edge)

Returns

intnumber of technologies banned

hatch-agent

to hatch-agent

Creates a duplicate of an agent by calling the function hatch on the agent calling the function and changes the new agent’s agent.agent-id to an id unused until now.

get-technology-type

to-report get-technology-type [my-technology]

Returns a technology-type with the same technology-type->technology-type-name as the technology->technology-name of the given technology

Parameter

my-technologythe technology to be used for searching a technology-type

Returns

technology-typewith the same technology-type.technology-type-name

get-technology-type-by-name

to-report get-technology-type-by-name [my-technology-type-name]

Returns a technology-type with the same technology-type->technology-type-name as given

Parameter

my-technologytype-namethe <technology-type-name> to be used for searching a technology-type

Returns

technology-typewith the same technology-type->technology-type-name

calculate-edge-delay

to-report calculate-edge-delay [my-edge my-technology]

Calculates edge-delay by considering edge-values, technology-values and (if present) factors influenced by controlling interventions

Parameters

my-edgethe edge entered
my-technologythe technology used to enter the edge

Returns

intdelay, the time an agent needs to wait on an edge until reaching the next node, measured in ticks.

calculate-costs-benefits

to-report calculate-costs-benefits [my-ie my-technology my-agent]

Calculates costs benefits based on an agent’s action; depends on location (node/edge), <technology-used>, control-factor and technology-dependency

Parameter

my-ieinfrastructure element (node/edge) that is entered by an agent.
my-technologythe technology used to enter my-ie

Returns

list of vectorsone vector of costs-benefits, used to update pay-offs and degree, for a) my-agent, b) my-ie, c) external each

check-technology-dependencies

to-report check-technology-dependencies [my-technology-factor my-technology-dependencies]

Checks, wether the technologie’s factor shall be used when calculating costs-benefits

Parameters

my-technology-factorvector of integers
my-technology-tependenciestrue/false-vector

Returns

listbased on my-technology-factor, where values without technology-dependency are substituted by “1”

replace-technology-name-in-actions

to-report replace-technology-name-in-actions [list-of-actions]

Replaces the technology in a (set of) actions by its <technology-name>

Parameter

list-of-actions[possibly nested] list of actions, item 2 contains technology-object

Returns

(nested) listsame length as input list, but item 2 of each action replaced by <technology-name>

names-of-technologies

to-report names-of-technologies

Reports the names of all technologies

Returns

listof <technology-names> of all technologies present in the scenario

names-of-technology-types

to-report names-of-technology-types

Reports the names of all technology-types

Returns

listof technology-type.technology-type-names

technology-usage

to-report technology-usage [agentset]

Reports the number of agents using each of the technologies that are part of the scenario running.

Parameters

agentsetthe agentset whose technology-usage shall be returned.  Returns:
listtechnology-type and number of turtles using it, formatted to be printed on screen or in output-files

technology-usage-percentage

to-report technology-usage-percentage [agentset]

Reports the npercentage of turtles using each of the technologies that are part of the scenario running.

Parameters

agentsetthe agentset whose technology-usage shall be returned.  Returns:
listtechnology-type and percentage of turtles using it, formatted to be printed on screen or in output-files

technology-usage-per-agentType

to-report technology-usage-per-agentType

Reports the number of turtles of each type who are using each of the technologies that are part of the scenario running.

Returns

nested list(agent-type, technology-type )and number of turtles using it, formatted to be printed on screen or in output-files

technology-usage-per-agentType-percentage

to-report technology-usage-per-agentType-percentage

Reports the percentage of turtles of each type who are using each of the technologies that are part of the scenario running.

Returns

nested list(agent-type, technology-type )and percentage of turtles using it, formatted to be printed on screen or in output-files

count-agent-type

to-report count-agent-type

Counts agents per agent-type

Returns

listeach element agent-type and number of agents of the respective type, formatted output-friendly.

agent-types-alive

to-report agent-types-alive

Reports the number of agents of each agent-type still alive.

Returns

listnumber of agents for each type of agent.

node-condition-id

to-report node-condition-id [my-node my-agent]

Reports true if the the id of the given node is part of the id-list given . May be used by specifying in input files and using runresult.

Parameter

my-nodenode-object, indicating the node whose ID shall be compared with those goven by ID within <agent-destinations-once>

Returns

booltrue or false.

node-condition-type

to-report node-condition-type [ my-val my-node]

Reports true if the the cost-benefits-value in my-dimension equals my-value.  May be used by specifying in input files and using runresult.

Parameter

my-nodenode-object, indicating the node whose ID shall be compared with those goven by ID within <agent-destinations-once>

Returns

booltrue or false.

get-node-condition-type-value

to-report get-node-condition-type-value [my-dimension my-node]

Reports the cost-benefits-value of the node given in the dimension given

Parameters

my-dimensionint, the dimension to be considered
my-nodethe node to be considered

Returns

intvalue specified by parameters and node-costs-benefits-agents

get-agent-destination-repetitive-value

to-report get-agent-destination-repetitive-value

Returns

intthe actual position of the agent-destinations-repetitive-pointer.

increase-agent-destinations-repetitive-position

to increase-agent-destinations-repetitive-position

Increases the actual position of the agent-destinations-repetitive-pointer by 1

create-technology

to-report create-technology [my-technology-type-name]

Instantiates a new technology object based on the technology-type reffered to via my-technology-type-name

Parameters

my-technology-type-namestring, indicating the <technoloy-type> to be used as base for the news technology

Returns

<technology>the newly created technology

count-technology-usage

to-report count-technology-usage

Counts number of ticks each technology was used in previous time within the running simulation.

Returns

tabletechnology->technology-name as key, value: number of ticks the respective technology was used by the calling agent.

get-unknown-technologies

to-report get-unknown-technologies [previously-used-technologies]

Returns those technologies present in the scenario that were never used by the agent and that s/he actually does not own.

Parameter

previusly-used-technologiestable, key: technology-name, value: number of ticks the respective technology was used by the agent.

Returns

listof technology-names

get-buyable-technologies

to-report get-buyable-technologies
Returns those technologies present in the scenario that the agent actually does not ownand thus may buy.

Returns

listof technology-names

update-pay-offs-node

to update-pay-offs-node [my-costs-benefits]

Updates the pay-offs (and degree) for node by adding the given values to pay-offs

Should be used in a node environment

Parameters

my-costs-benefitscosts and benefits (multi-dimensional) to be added to the nodes’ pay-offs

update-pay-offs-agent

to update-pay-offs-agent [my-costs-benefits]

Updates the pay-off- and degree-vectors for an agent

Should be used in a agent environment and triggered by an edge or node.

Parameters

my-costs-benefitscosts and benefits (multi-dimensional) to be added to the nodes’ pay-offs

update-pay-offs-edge

to update-pay-offs-edge [my-costs-benefits]

Updates the pay-offs (and degree) for edge with the given technology factor

Should be used in a edge environment

Parameters

my-costs-benefitscosts and benefits (multi-dimensional) to be added to the nodes’ pay-offs

update-node-degree

to update-node-degree

Updates the degree vectors of the calling node as well as edge-overcrowded?.

Should be used in a node environment

update-edge-degree

to update-edge-degree

Updates the degree vectors of the calling edge as well as edge-overcrowded?.

Should be used in an edge environment

update-edge-pay-offs-external

to update-edge-pay-offs-external [my-costs-benefits]

Updates the pay-offs for externals, considering the technology given.

Should be used in an edge or node environment

Parameters

my-technology<techology> used by agent when entering the node or <edge>node

update-node-pay-offs-external

to update-node-pay-offs-external [my-costs-benefits]

Updates the pay-offs for externals, considering the technology given.

Should be used in a node environment

Parameters

my-technology-factortechology factor to use for update
to check-payoff-reset
Procedure to reset short or long time payoffs if short-time or long-time periods are completed.
to-report get-technology-by-id [id]
Gives a technology by technology-id.
to-report get-technology-by-name [name]
Gives a technology by technology->technology-name.
Holds the technologies
the technologie’s name.
to-report get-technologies-by-name [list-of-technology-names]
Gives a list of technologies by their technology->technology-names.
Hold the technology objects.
to-report get-agent [id]
Gives an agent by agent->agent-id.
Holds the agents and information like the technology owned, actual state based on previous actions and variables used for calculate-utility (SEU calculation)
“who” is used for all breeds, thus for nodes as well as for agents.
to-report get-dimension [dimension-name]
Gives the number of the dimension given by name
to-report get-edge-technology-banned
Reports which technologies are (temporarily) banned, allowed or (completely) impossible to use on the calling edge.
Holds the edges
to-report get-from-node [edge]
Gives from-node of edge
to-report get-to-node [edge]
Gives to-node of edge
to-report sort-edges [ A B order?]
Sort edges by their ID or their predecessor and successor nodes
to-report fpp [my-content]
Floating point precision, checks precision for all list elements Fix for known NetLogo floating point precision issue
to-report add-all-but-first [list-a list-b]
Adds all list elements execpt the first
to decrease-count-agents-node [my-count]
Decreases the first dimension “capacity” by subtracting the given parameter from short-time-pay-offs
to decrease-count-agents-edge [my-count]
Decreases the first dimension “capacity” by subtracting the given parameter from short-time-pay-offs
to increase-count-agents-node [my-count]
Increases the first dimension “capacity” by adding the given parameter to all pay-offs
to increase-count-agents-edge [my-count]
Increase the first dimension “capacity” by adding the given parameter to all pay-offs
to-report check-first-dimension [my-list my-value]
Checks if first dimension of given list is set to the given value
to check-death
Handles check of death for all objects that can die: nodes, edges, agents, technologies
to check-technologies-death [my-technologies]
Checks possible death of technologies, due to end of lifetime
to check-nodes-death
Checks possible death of nodes, due to end of lifetime
to check-edges-death
Checks possible death of edges, due to end of lifetime (or death of a node connected to that edge, see check-nodes-death.)
to check-agents-death
Checks possible death of agents due to several reasons: reaching a final node, exceeding limits etc.
to reset-agent-technologies
Creates new technology-objects based on the present ones, will be called when hatching agents.
to reset-agent-state-variables
Sets agent-state-variables to zero values, to be used when hatching agents or in agent setup.
to increase-deaths
Increases count of death of respective type if an agent dies.
to-report check-death-by-location
Checks if an agent has reached a final node and should be removed from the simulation
to-report check-death-by-limit
Checks if an agent has exceeded one of his long-time-limits and should be removed from simulation.
to set-edge-overcrowded
Handle overcrowded status for edges
to set-node-overcrowded
Handle overcrowded status for nodes
to-report get-node [id]
Gives a node by node-id.
to-report check-dontcare [list-to-check]
Replace every occurence of “e” (Euler’s number) in a list by false (is used to encode “don’t care” in input files of SimCo).
to-report calculate-degree-vector [time]
Calculates the degree vector of the calling entity
to-report degree [dimension time]
Report the degree of a value compared to its limits
to-report calculate-degree [my-lower-limit my-upper-limit my-value]
Calculate degree for value between lower and upper limit
to-report get-payoff [dimension time]
Reports the actual value of respective object (agent, node, edge) for the given dimension and time.
Hold the nodes’ information concerning their characteristics as well as actual values, indicating their state.
to-report limits [dimension time]
Reports the two limits given for a specific dimension, either for short- or long-time, depending on the callers breed!
to-report technology-allowed-on? [my-IE my-technology]
Checks wether a technology is allowed to be used on an infrastructure element.
to-report technology-available? [my-technology]
Checks wether the given technology is in the set of agent.agent-technologies-available and still alive
all technologies the agent owns and thus may use.
to-report technology-available-by-name? [my-technology-name]
Checks wether the technology, given by its technology.technology-name is in the set of agent.agent-technologies-available
to-report technology-in-use? [my-technology]
Checks wether the given technology actually is used by the agent
to-report technology-type-in-use? [my-technology-type]
Checks wether the a technology corresponding to the given technology-type actually is used by the agent
Used to hold characteristics of technology types, will be used as base when instantiating agent-individuall objects of type technology.
to-report add-technologies-allowed [my-origin my-destinations]
Parses edges from origin to all destinations and adds technology->technology-names of that technlogies that are allowed on the edge as well as on the respective destination node to the resulting list
Hold the edges.
to-report get-technologies-allowed [ie]
Gives all allowed technologies on the given element (node or edge)
to remove-technology [my-technology]
Removes a technology from the set of an agent’s agent->agent-technologies-available.
to-report number-of-technologies-banned [ie]
Gives the number of banned technologies on the given infrastructure element (node or edge)
to hatch-agent
Creates a duplicate of an agent by calling the function hatch on the agent calling the function and changes the new agent’s agent.agent-id to an id unused until now.
to-report get-technology-type [my-technology]
Returns a technology-type with the same technology-type->technology-type-name as the technology->technology-name of the given technology
the technology-type’s name
to-report get-technology-type-by-name [my-technology-type-name]
Returns a technology-type with the same technology-type->technology-type-name as given
to-report calculate-edge-delay [my-edge my-technology]
Calculates edge-delay by considering edge-values, technology-values and (if present) factors influenced by controlling interventions
to-report calculate-costs-benefits [my-ie my-technology my-agent]
Calculates costs benefits based on an agent’s action; depends on location (node/edge), technology-used, control-factor and technology-dependency
to-report check-technology-dependencies [my-technology-factor my-technology-dependencies]
Checks, wether the technologie’s factor shall be used when calculating costs-benefits
to-report replace-technology-name-in-actions [list-of-actions]
Replaces the technology in a (set of) actions by its technology-name
to-report names-of-technologies
Reports the names of all technologies
to-report names-of-technology-types
Reports the names of all technology-types
to-report technology-usage [agentset]
Reports the number of agents using each of the technologies that are part of the scenario running.
Hold the agents.
to-report technology-usage-percentage [agentset]
Reports the npercentage of turtles using each of the technologies that are part of the scenario running.
to-report technology-usage-per-agentType
Reports the number of turtles of each type who are using each of the technologies that are part of the scenario running.
to-report technology-usage-per-agentType-percentage
Reports the percentage of turtles of each type who are using each of the technologies that are part of the scenario running.
to-report count-agent-type
Counts agents per agent-type
to-report agent-types-alive
Reports the number of agents of each agent-type still alive.
to-report node-condition-id [my-node my-agent]
Reports true if the the id of the given node is part of the id-list given .
to-report node-condition-type [ my-val my-node]
Reports true if the the cost-benefits-value in my-dimension equals my-value.
to-report get-node-condition-type-value [my-dimension my-node]
Reports the cost-benefits-value of the node given in the dimension given
to-report get-agent-destination-repetitive-value
to increase-agent-destinations-repetitive-position
Increases the actual position of the agent-destinations-repetitive-pointer by 1
to-report create-technology [my-technology-type-name]
Instantiates a new technology object based on the technology-type reffered to via my-technology-type-name
to-report count-technology-usage
Counts number of ticks each technology was used in previous time within the running simulation.
to-report get-unknown-technologies [previously-used-technologies]
Returns those technologies present in the scenario that were never used by the agent and that s/he actually does not own.
to-report get-buyable-technologies
to update-pay-offs-node [my-costs-benefits]
Updates the pay-offs (and degree) for node by adding the given values to pay-offs
to update-pay-offs-agent [my-costs-benefits]
Updates the pay-off- and degree-vectors for an agent
to update-pay-offs-edge [my-costs-benefits]
Updates the pay-offs (and degree) for edge with the given technology factor
to update-node-degree
Updates the degree vectors of the calling node as well as edge-overcrowded?.
to update-edge-degree
Updates the degree vectors of the calling edge as well as edge-overcrowded?.
to update-edge-pay-offs-external [my-costs-benefits]
Updates the pay-offs for externals, considering the technology given.
to update-node-pay-offs-external [my-costs-benefits]
Updates the pay-offs for externals, considering the technology given.
the individual ID of the technology.
integer, node-id allows to adress all nodes p.e.
Close