libs/helpers-output.nls

Handling all output helpers, p.e. for formatting output-files, generating file-names etc.

Summary
libs/helpers-output.nlsHandling all output helpers, p.e.
debugPrints out a message if logging is activated and debugging level of the message to be printed is equal to or lower than log-level Level 0: dangerous errors, simulation is about to halt.
outPrints out a message if context (for example “SEU”) is activated for output.
setup-result-file-namesCreates unique file-names for all result-files in a uniform manner, using behaviorspace-run-number and behaviorspace-experiment-name, if automated-run? 
add-result-fileCreates a result file based on base-file (which is the same for all result-files of a scenario-run) and extension (indicating the type of result), adds file to result-file-names table and prints header-line to the file.
list-to-comma-stringGives a string of the list (and lists in the list as well)
list-to-semicolon-stringGives a string of the list (and lists in the list as well)
list-to-stringGives a string of the list
string-list-to-stringGives a string-marked string of the list
mediawiki-table-printPrints a tabular in wikimedia-table-style based on the content given
mediawiki-table-printlinePrints a single line and inserts mediawiki-table cell separator “|” between cells
mediawiki-table-beginPrints the standard header of a mediawiki-table
mediawiki-table-endPrints the standard footer of a mediawiki-table
mediawiki-table-newlinePrints the newline-code of a mediawiki-table
redminewiki-table-printPrints a tabular in redminewike-style based on the content given
redminewiki-table-printlinePrints a single line and inserts redminewiki-table cell separator “|” between cells
write-plotsWrites plots’ history
write-node-historyWrites nodes’ history
write-node-stats-rawWrite nodes’ statistics (raw-values)
write-node-statsWrite nodes’ statistics (mean-values, medians and standard-deviations)
write-edge-historyWrites edges’ history
write-edge-statsWrite edges’ statistics (mean-values, medians and standard-deviations)
write-edge-stats-raw; Write edges’ statistics (raw-values)
write-technology-type-stats-rawWrite technology-types’ statistics (raw-values)
write-technology-type-statsWrite technology-types’ statistics (mean-values, medians and standard-deviations)
write-agent-seuWrites agents’ seu-calculation history
write-agent-historyWrites agents’ history
write-agent-stats-rawWrites agents’ statistics (raw-values)
write-agent-statsWrites agents’ statistics (mean-values, medians and standard-deviations)
write-global-statsWrites global statistics (mean-values, medians and standard-deviations)
write-global-stats-rawWrites global statistics (raw values)
write-node-resultsTriggers all functions handling output of nodes’ results
write-edge-resultsTriggers all functions handling output of edges’ results
write-technology-type-resultsTriggers all functions handling output of technology-types’ results
write-agent-resultsTriggers all functions handling output of agents’ results
write-global-resultsTriggers all functions handling output of global results
write-resultsWrites results generated within running a scenario.

debug

to debug [level message]

Prints out a message if logging is activated and debugging level of the message to be printed is equal to or lower than log-level Level 0: dangerous errors, simulation is about to halt.  Level 1: errors Level 2: warnings like functions returning nobody or empty lists.  Level 3: function calls.

Parameters

levelint, level of message
messagetext to print

out

to out [context message sender]

Prints out a message if context (for example “SEU”) is activated for output.  Can be restricted to single senders by specifiyng a “who” number in GUI.

Parameters

contextthe string, semantic context of the message to be printed, used to filter messages.  See <Out-level> in GUI.
messagestring, the message to be printed
sender”who” number of the sending agent

setup-result-file-names

to setup-result-file-names

Creates unique file-names for all result-files in a uniform manner, using behaviorspace-run-number and behaviorspace-experiment-name, if automated-run? is true.

add-result-file

to add-result-file [base-file extension header-line]

Creates a result file based on base-file (which is the same for all result-files of a scenario-run) and extension (indicating the type of result), adds file to result-file-names table and prints header-line to the file.

Parameters

base-filestring, containing first part of file-name
extensionstring, containing second part of file-name
header-linestring, indicating the first line to be written after creation of the result-file.

list-to-comma-string

to-report list-to-comma-string [li]

Gives a string of the list (and lists in the list as well)

Parameters

lilist

Returns

comma separated stringof list elements

list-to-semicolon-string

to-report list-to-semicolon-string [li]

Gives a string of the list (and lists in the list as well)

Parameters

lilist

Returns

semicolon separated stringof list elements

list-to-string

to-report list-to-string [li sep]

Gives a string of the list

Parameters

lithe list to be returned as string
septhe separator to be used between list items

Returns

stringof list elements, separated by sep

string-list-to-string

to-report string-list-to-string [li]

Gives a string-marked string of the list

Parameters

lilist

Returns

stringspace seperated, per element quoted string of list elements

mediawiki-table-print

to mediawiki-table-print [list-of-lines]

Prints a tabular in wikimedia-table-style based on the content given

Parameter

list-of-linesnested list, where each sub-list will be printed as a separate line and thus shall contain the same number of tabular cells

mediawiki-table-printline

to mediawiki-table-printline [content]

Prints a single line and inserts mediawiki-table cell separator “|” between cells

Parameter

contentlist, where each element will be printed as a single cell

mediawiki-table-begin

to mediawiki-table-begin

Prints the standard header of a mediawiki-table

mediawiki-table-end

to mediawiki-table-end

Prints the standard footer of a mediawiki-table

mediawiki-table-newline

to mediawiki-table-newline

Prints the newline-code of a mediawiki-table

redminewiki-table-print

to redminewiki-table-print [list-of-lines]

Prints a tabular in redminewike-style based on the content given

Parameter

list-of-linesnested list, where each sub-list will be printed as a separate line and thus shall contain the same number of tabular cells

redminewiki-table-printline

to redminewiki-table-printline [content]

Prints a single line and inserts redminewiki-table cell separator “|” between cells

Parameter

contentlist, where each element will be printed as a single cell

write-plots

to write-plots

Writes plots’ history

write-node-history

to write-node-history [my-nodes]

Writes nodes’ history

Parameters

my-nodesset of nodes that shall write their output

write-node-stats-raw

to write-node-stats-raw [my-nodes]

Write nodes’ statistics (raw-values)

Parameters

my-nodesset of nodes that shall write their output

write-node-stats

to write-node-stats [my-nodes]

Write nodes’ statistics (mean-values, medians and standard-deviations)

Parameters

my-nodesset of nodes that shall write their output

write-edge-history

to write-edge-history [my-edges]

Writes edges’ history

Parameters

my-edgesset of edges that shall write their output

write-edge-stats

to write-edge-stats [my-edges]

Write edges’ statistics (mean-values, medians and standard-deviations)

Parameters

my-edgesset of edges that shall write their output

write-edge-stats-raw

to write-edge-stats-raw [my-edges]

; Write edges’ statistics (raw-values)

Parameters

my-edgesset of edges that shall write their output

write-technology-type-stats-raw

to write-technology-type-stats-raw [my-technology-types]

Write technology-types’ statistics (raw-values)

Parameters

my-technology-typesset of technology-types that shall write their output

write-technology-type-stats

to write-technology-type-stats [my-technology-types]

Write technology-types’ statistics (mean-values, medians and standard-deviations)

Parameters

my-technology-typesset of technology-types that shall write their output

write-agent-seu

to write-agent-seu [my-agents]

Writes agents’ seu-calculation history

Parameters

my-agentsagentset of agents that shall write their results.

write-agent-history

to write-agent-history [my-agents]

Writes agents’ history

Parameters

my-agentsagentset of agents that shall write their results.

write-agent-stats-raw

to write-agent-stats-raw [my-agents]

Writes agents’ statistics (raw-values)

Parameters

my-agentsagentset of agents that shall write their results.

write-agent-stats

to write-agent-stats [my-agents]

Writes agents’ statistics (mean-values, medians and standard-deviations)

Parameters

my-agentsagentset of agents that shall write their results.

write-global-stats

to write-global-stats

Writes global statistics (mean-values, medians and standard-deviations)

write-global-stats-raw

to write-global-stats-raw

Writes global statistics (raw values)

write-node-results

to write-node-results [my-nodes]

Triggers all functions handling output of nodes’ results

Parameters

my-nodesset of nodes that shall write their output

write-edge-results

to write-edge-results [my-edges]

Triggers all functions handling output of edges’ results

Parameters

my-edgesset of edges that shall write their output

write-technology-type-results

to write-technology-type-results [my-technologies]

Triggers all functions handling output of technology-types’ results

Parameters

my-technologiesset of technologies that shall write their output

write-agent-results

to write-agent-results [my-agents]

Triggers all functions handling output of agents’ results

Parameters

my-agentsagentset of agents that shall write their results.

write-global-results

to write-global-results

Triggers all functions handling output of global results

write-results

to write-results

Writes results generated within running a scenario.  Will be used mainly from behaviour space at the end ofan experiment run.  Elements dying before have to call the respective subroutines before exiting the simulation.

to debug [level message]
Prints out a message if logging is activated and debugging level of the message to be printed is equal to or lower than log-level Level 0: dangerous errors, simulation is about to halt.
to out [context message sender]
Prints out a message if context (for example “SEU”) is activated for output.
to setup-result-file-names
Creates unique file-names for all result-files in a uniform manner, using behaviorspace-run-number and behaviorspace-experiment-name, if automated-run? 
to add-result-file [base-file extension header-line]
Creates a result file based on base-file (which is the same for all result-files of a scenario-run) and extension (indicating the type of result), adds file to result-file-names table and prints header-line to the file.
to-report list-to-comma-string [li]
Gives a string of the list (and lists in the list as well)
to-report list-to-semicolon-string [li]
Gives a string of the list (and lists in the list as well)
to-report list-to-string [li sep]
Gives a string of the list
to-report string-list-to-string [li]
Gives a string-marked string of the list
to mediawiki-table-print [list-of-lines]
Prints a tabular in wikimedia-table-style based on the content given
to mediawiki-table-printline [content]
Prints a single line and inserts mediawiki-table cell separator “|” between cells
to mediawiki-table-begin
Prints the standard header of a mediawiki-table
to mediawiki-table-end
Prints the standard footer of a mediawiki-table
to mediawiki-table-newline
Prints the newline-code of a mediawiki-table
to redminewiki-table-print [list-of-lines]
Prints a tabular in redminewike-style based on the content given
to redminewiki-table-printline [content]
Prints a single line and inserts redminewiki-table cell separator “|” between cells
to write-plots
Writes plots’ history
to write-node-history [my-nodes]
Writes nodes’ history
to write-node-stats-raw [my-nodes]
Write nodes’ statistics (raw-values)
to write-node-stats [my-nodes]
Write nodes’ statistics (mean-values, medians and standard-deviations)
to write-edge-history [my-edges]
Writes edges’ history
to write-edge-stats [my-edges]
Write edges’ statistics (mean-values, medians and standard-deviations)
to write-edge-stats-raw [my-edges]
; Write edges’ statistics (raw-values)
to write-technology-type-stats-raw [my-technology-types]
Write technology-types’ statistics (raw-values)
to write-technology-type-stats [my-technology-types]
Write technology-types’ statistics (mean-values, medians and standard-deviations)
to write-agent-seu [my-agents]
Writes agents’ seu-calculation history
to write-agent-history [my-agents]
Writes agents’ history
to write-agent-stats-raw [my-agents]
Writes agents’ statistics (raw-values)
to write-agent-stats [my-agents]
Writes agents’ statistics (mean-values, medians and standard-deviations)
to write-global-stats
Writes global statistics (mean-values, medians and standard-deviations)
to write-global-stats-raw
Writes global statistics (raw values)
to write-node-results [my-nodes]
Triggers all functions handling output of nodes’ results
to write-edge-results [my-edges]
Triggers all functions handling output of edges’ results
to write-technology-type-results [my-technologies]
Triggers all functions handling output of technology-types’ results
to write-agent-results [my-agents]
Triggers all functions handling output of agents’ results
to write-global-results
Triggers all functions handling output of global results
to write-results
Writes results generated within running a scenario.
Used to hold characteristics of technology types, will be used as base when instantiating agent-individuall objects of type technology.
Hold the technology objects.
Close