Helper functions to handle lists and sets.
libs/ | Helper functions to handle lists and sets. |
prefix-list-items | Adds the given string as prefix to all list items |
postfix-list-items | Adds the given string as postfix to all list items |
createList | Reports a list with the same number of elements as the given base list (alternatively the number may be given), each item has the given value. |
risingList | Gives a list of rising values starting from 0 |
intersect-sets | Calculates the intersection of sets (for example sets of technologies.) |
intersect-lists | Calculates the intersection of lists (for example lists containing technology->technology-names.) |
intersect-technology-sets-by-name | Calculates the intersection of a set of technologies and a list of technology->technology-names by using the names as matching parameter. |
change-all-but-first-element | Changes all list elements execpt the first |
read-list-from-string | Reads all items of a list from a string |
append-to-list | Appends the given string and value-list to the given list |
add-boolean | Adds the given boolean to each element of the given list |
to-report createList [input value]
Reports a list with the same number of elements as the given base list (alternatively the number may be given), each item has the given value.
input | list or number |
value | value for each element |
list | list of input length (by length of list or by number) with each element set to value |
to-report intersect-sets [set-a set-b]
Calculates the intersection of sets (for example sets of technologies.)
set-a | Agentset that shall be intersected with set-b |
set-b | Agentset of the same type (agents, nodes, edges, technologies etc) as set-a. |
agentset | The set of elements that are part of both input sets. |
to-report intersect-lists [list-a list-b]
Calculates the intersection of lists (for example lists containing technology->technology-names.)
list-a | list of strings |
list-b | list of strings |
list of strings | The list of strings contains that strings from the input which are part of both lists. |
to-report intersect-technology-sets-by-name [technology-set technology-name-list]
Calculates the intersection of a set of technologies and a list of technology->technology-names by using the names as matching parameter.
technology-set | agentset of technologies |
technology-name-list | list of strings, technology.technology-names |
agentset of <technologies> | The agentset of technologies that is represented in both parameters (as technology or by technology.technology-name). |
to-report change-all-but-first-element [old-list change-list]
Changes all list elements execpt the first
old-list | list to change (first element will be preserved) |
change-list | list of new values (first element will be ignored) |
list | list of new values execpt for first element |
to-report append-to-list [my-list item-type value-list]
Appends the given string and value-list to the given list
my-list | list to be altered |
item-type | string to be used as key |
value-list | source-list, to be addes element-wise as content to my-list |
list | my-list, supplemented by item-type and value-list |
Adds the given string as prefix to all list items
to-report prefix-list-items [li pre]
Adds the given string as postfix to all list items
to-report postfix-list-items [li post]
Reports a list with the same number of elements as the given base list (alternatively the number may be given), each item has the given value.
to-report createList [input value]
Gives a list of rising values starting from 0
to-report risingList [numberItems]
Calculates the intersection of sets (for example sets of technologies.)
to-report intersect-sets [set-a set-b]
Calculates the intersection of lists (for example lists containing technology->technology-names.)
to-report intersect-lists [list-a list-b]
Calculates the intersection of a set of technologies and a list of technology->technology-names by using the names as matching parameter.
to-report intersect-technology-sets-by-name [technology-set technology-name-list]
Changes all list elements execpt the first
to-report change-all-but-first-element [old-list change-list]
Reads all items of a list from a string
to-report read-list-from-string [content]
Appends the given string and value-list to the given list
to-report append-to-list [my-list item-type value-list]
Adds the given boolean to each element of the given list
to-report add-boolean [my-list my-boolean]