Handling all SEU functions, dealing with agent’s process of taking decisions.
libs/ | Handling all SEU functions, dealing with agent’s process of taking decisions. |
choose-action | Agent takes a decision about the next action to take. |
calculate-best-action | Calculates the best action for the given possible destinations |
calculate-utility | Calculates subjective expected utility for the given action, where action consists of 3 ordered items: node-to-take, edge-to-take, technology-to-use |
calculate-p-technology-preference | Calculates p-value for SEU calculation for a “hidden” goal, advancing some given technology, independent from situational parameters. |
calculate-p-costs | Calculates p-value for SEU calculation for a goal like money-saving. |
calculate-p-money | Calculates p-value for SEU calculation for a goal like money-saving. |
calculate-p-costs-simple | Calculates p-value for SEU calculation for a goal like money-saving. |
calculate-p-money-simple | Calculates p-value for SEU calculation for a goal like money-saving. |
linear-function | Calculates y-value of a point P3 on a straight line, given by two (different!) |
calculate-p-duration | calculates p-value based on (given) duration of using an edge. |
calculate-p | Holds metrics used to calculate probabilities “p” used in SEU-calculation. |
node-condition-type-p | Reports 1 if the cost-benefits-value in my-dimension equals my-value. |
print-p-calculations | Prints all p-calculation formulas for debugging purposes |
agent-technology-switch-allowed | Reports, whether an agent my switch technologies on the given node (based on item 2 node-costs-benefits-agents). |
check-p | Ensures that the int given as input does not exceed the limits of [0,1], because p-values are probabilities and thus restricted by these values. |
compute-neighbors | Computes all direct neighbors which are are connected to the given node. |
check-edge-alive | Checks, if edges are still alive and thus may be used in choose-action. |
to-report choose-action
Agent takes a decision about the next action to take. This includes a node to visit, as well as the edge and the technology used to reach the node. Choosing an action depends on situational constraints like the position the agent is actually located and on his rating of goals, as the agent will calculate the subjective expexted utility (SEU) in calculate-utility for each of the actions available.
ordered list | node to reach, edge to use, technology to use. |
empty list | if there is no action available for the agent. |
to-report calculate-best-action [possible-destinations]
Calculates the best action for the given possible destinations
possible-destinations | contains a set of technologies for each node/edge combination |
list | contains exactly one action, given as node, edge, technology, represents the best action out of the given possible destinations and based on calculated subjective utility values |
empty-list | if there is no action available at all (should not happen normally). |
to-report calculate-utility [my-action]
Calculates subjective expected utility for the given action, where action consists of 3 ordered items: node-to-take, edge-to-take, technology-to-use
my-action | ordered list of random node-to-take, edge-to-take, technology-to-use |
floating point number | utility of the given action, based on SEU calculation. U-values are agents-own, p-values calculated on the fly |
to-report calculate-p-technology-preference [my-technology-name my-technology]
Calculates p-value for SEU calculation for a “hidden” goal, advancing some given technology, independent from situational parameters.
my-technology-name | the name of the technology that should be preferred |
my-technology-name | the technology that is part of the action actually handled |
to-report calculate-p-costs [my-vector my-dimension my-time-horizon my-factor]
Calculates p-value for SEU calculation for a goal like money-saving. Besides integrating the costs of an action to this calculation, the pay-off gained in previous steps (aka “bank balance”) is taken into consideration. This function assumes that the semantics is bases on the term “costs”. Thus, a positive value indicates costs (or in other words: money that must be paid), a negative value can be accounted as income.
my-vector | the costs-benefits-vector of the action for which the p-value shall be calculated |
my-dimension | int, the “costs” dimension’s number |
my-time-horizon | string, short- or long time (the respective payoff will be used) |
my-factor | or borderline, indicating how far the costs-payoff shall influence the resulting p-value. |
floating point number | p-value |
to-report calculate-p-money [my-vector my-dimension my-time-horizon my-factor]
Calculates p-value for SEU calculation for a goal like money-saving. Besides integrating the costs (money-dimension) of an action to this calculation, the pay-off gained in previous steps (aka “bank balance”) is taken into consideration. This function assumes that the semantics is bases on the term “money”. Thus, a negative value indicates costs (or in other words: money that must be paid), a positive value can be accounted as income.
my-vector | the costs-benefits-vector of the action for which the p-value shall be calculated |
my-dimension | int, the “money’s” dimension’s number |
my-time-horizon | string, short- or long time (the respective payoff will be used) |
my-factor | or borderline, indicating how far the costs-payoff shall influence the resulting p-value. |
floating point number | p-value |
to-report calculate-p-costs-simple [my-vector my-dimension my-time-horizon my-factor]
Calculates p-value for SEU calculation for a goal like money-saving. Uses costs of the action and a borderline as parameters, only.
my-vector | the costs-benefits-vector of the action for which the p-value shall be calculated |
my-dimension | int, the “costs” dimension’s number |
my-time-horizon | string, short- or long time (the respective payoff will be used) |
my-factor | borderline, indicating which values are evaluated as “too expensive” |
floating point number | p-value |
to-report linear-function [x1 y1 x2 y2 x]
Calculates y-value of a point P3 on a straight line, given by two (different!) points on that line (P1/P2) as well as the x-value of point P3.
x1 | x-value of P1 |
y1 | y-value of P1 |
x2 | x-value of P2 |
y2 | y-value of P2 |
x | x-value of point P3 to be calculated |
floating point number | y-value of point P3 to be calculated |
to-report calculate-p-duration [my-duration upper-border]
calculates p-value based on (given) duration of using an edge. Upper border indicates borderline with p=0
my-duration | int, length of duration (ticks) |
upper-border | time-value (ticks) which shall lead to a p-value of 0 |
floating point number | p-value for the given parameters |
to-report calculate-p [my-metric my-dimension my-vector my-parameter]
Holds metrics used to calculate probabilities “p” used in SEU-calculation. Some of these were implemented for very special purposes and scenarios.
my-metric | calculation-method to be used |
my-dimension | dimension (of limits) to be considered |
my-vector | vector with situational parameters to be used within calculation |
my-parameter | parameter to be used within the respective metric, semantics may differ between metrics. |
floating point number | p-value for the given parameters |
to-report node-condition-type-p [my-dimension my-value my-node]
Reports 1 if the cost-benefits-value in my-dimension equals my-value. May be used by specifying in input files and using runresult.
my-node | node-object, indicating the node whose ID shall be compared with those goven by ID within <agent-destinations-once> |
int | 1 or 0. |
to-report agent-technology-switch-allowed? [my-node]
Reports, whether an agent my switch technologies on the given node (based on item 2 node-costs-benefits-agents).
my-node | node on which technology shall be switched |
bool | true, if agent may switch technology on my-node, false otherwise |
Computes all direct neighbors which are are connected to the given node. Boundary conditions: Neighbor as well as the edge connecting it are “alive” and there exists a technology that may be used on the connected node as well as on the connecting edge.
my-node | starting node. This will in most cases be the node the agent is actually on. |
ordered nested list | all nodes reacheable from the one given as input as well as the technology->technology-names indicating which technologies may be used to reach the node. Basic version implemented: report all possible nodes, if they can be reached by a technology-allowed on the edge that is allowd on the node, too! Future extension: As this may heavily depend on the mode of governance or the net-logics, rework this function in the future. |
empty list | if there is no edge to any of the neighbor-nodes usable with a technology allowed on the neighbor-nodes as well. |
to-report check-edge-alive [my-from-node my-to-nodes]
Checks, if edges are still alive and thus may be used in choose-action.
my-from-node | node the edges to check start from |
my-to-nodes | list of nodes, each of them the end of an edge |
list | of nodes, including only those nodes from my-to-nodes, that can be reached with an edge still alive. |
Agent takes a decision about the next action to take.
to-report choose-action
Calculates the best action for the given possible destinations
to-report calculate-best-action [possible-destinations]
Calculates subjective expected utility for the given action, where action consists of 3 ordered items: node-to-take, edge-to-take, technology-to-use
to-report calculate-utility [my-action]
Calculates p-value for SEU calculation for a “hidden” goal, advancing some given technology, independent from situational parameters.
to-report calculate-p-technology-preference [my-technology-name my-technology]
Calculates p-value for SEU calculation for a goal like money-saving.
to-report calculate-p-costs [my-vector my-dimension my-time-horizon my-factor]
Calculates p-value for SEU calculation for a goal like money-saving.
to-report calculate-p-money [my-vector my-dimension my-time-horizon my-factor]
Calculates p-value for SEU calculation for a goal like money-saving.
to-report calculate-p-costs-simple [my-vector my-dimension my-time-horizon my-factor]
Calculates y-value of a point P3 on a straight line, given by two (different!)
to-report linear-function [x1 y1 x2 y2 x]
calculates p-value based on (given) duration of using an edge.
to-report calculate-p-duration [my-duration upper-border]
Holds metrics used to calculate probabilities “p” used in SEU-calculation.
to-report calculate-p [my-metric my-dimension my-vector my-parameter]
Reports 1 if the cost-benefits-value in my-dimension equals my-value.
to-report node-condition-type-p [my-dimension my-value my-node]
Prints all p-calculation formulas for debugging purposes
to print-p-calculations
Reports, whether an agent my switch technologies on the given node (based on item 2 node-costs-benefits-agents).
to-report agent-technology-switch-allowed? [my-node]
Ensures that the int given as input does not exceed the limits of [0,1], because p-values are probabilities and thus restricted by these values.
to-report check-p [my-p]
Checks, if edges are still alive and thus may be used in choose-action.
to-report check-edge-alive [my-from-node my-to-nodes]