SimCo-simple.nlogo

Simco training tool v0.2

Shares the code base with SimCo, but provides an easier to use GUI.

2017

Fabian Adelt, Johannes Weyer, Robin D.  Fink, Andreas Ihrig (TU Dortmund University)

Licence

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.  You should have received a copy of the GNU General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

Extensions

tablehelpers for tables
arrayhelpers for arrays
stringstring handling
goochange gui-elements
pathdirdirectory handling
filefile handling
statshandling of simulation data, including some basic statistic methods
profilermeasuring time each functions needs (calling sub-functions included and excluded) as well as number of calls

Includes

setup.nlscontains all setup routines (libs/setup.nls)
variables.nlscontains all breed- and global-variabelles (libs/variables.nls)
helpers.nlscontains some helper functions (libs/helpers.nls)
helpers-simco.nlscontains some helper functions which are solely usable within simco (libs/helpers-simco.nls)
helpers-visualization.nlscontains code for visual representation of the macro-layer (libs/helpers-visualization.nls)
helpers-visualization-simco.nlscontains code for visual representation of the macro-layer which are solely usable within SimCo (libs/helpers-visualization-simco.nls)
hubnet.nlscontains code for hubnet features (libs/hubnet.nls)
automated-control.nlscontains routines for the automated control (libs/automated-control.nls)
helpers-SEU.nlscontains routines and helpers for agents’ decision-taking, based on subjective expected utility (SEU) (libs/helpers-SEU.nls)
helpers-input.nlscontains helper functions for reading input files (libs/helpers-input.nls)
helpers-output.nlscontains helper functions for writing output files, generating the respective file-names etc.  (libs/helpers-output.nls)
helpers-file-handling.nlscontains functions to handle files and folders (libs/helpers-file-handling.nls)
helpers-lists.nlscontains functions for basic list operations (libs/helpers-lists.nls)
interactions.nlscontains functions handling all interactions between agents, technologies and infrastructure elements (nodes and edges) (libs/interactions.nls)
Summary
SimCo-simple.nlogoSimco training tool v0.2
globalSome global variables which are present in full SimCo’s GUI and need to be substituted here.
global variables
goMain function to run the simulation.
degrade-allDecreases all pay-offs by the global->global-agents-degradation vector for agents, nodes and edges.
agents-runMain function for all agent actions: Entering and leaving nodes and edges and taking decisions about the next node an agent wants to reach.
update-historyUpdates history for all elements of the simulation.
startupStarts the hubnet functions

global

Some global variables which are present in full SimCo’s GUI and need to be substituted here.

Summary
global variables
goMain function to run the simulation.
degrade-allDecreases all pay-offs by the global->global-agents-degradation vector for agents, nodes and edges.
agents-runMain function for all agent actions: Entering and leaving nodes and edges and taking decisions about the next node an agent wants to reach.
update-historyUpdates history for all elements of the simulation.
startupStarts the hubnet functions

global variables

out-levelstring, indicating which level of information shall be used by “out” function
debug-levelint, indicating which level of information shall be used by “debug” function
out?bool, shall “out” output be printed?
debugging?bool, shall “debug” output be printed?
hubnet?bool, shall hubnet part of Simco be started?  Used for alternative views, experimental.
use-snfbool, shall the standard scenario format “snf” be used?
out-whoint, indicating which agent shall be used for inspection in full SimCo
followme?bool, shall an agent by marked in GUI to follow it’s movement?
inspect?bool, shall
save-history?bool,
purchase?bool,
l-e-z-fint,
l-e-z-rint, visualize-node -

go

to go

Main function to run the simulation.

degrade-all

to degrade-all

Decreases all pay-offs by the global->global-agents-degradation vector for agents, nodes and edges.  Furthermore, lifetime-values of nodes, edges and technologies are reduced by 1.

agents-run

to agents-run

Main function for all agent actions: Entering and leaving nodes and edges and taking decisions about the next node an agent wants to reach.  ;

update-history

to update-history

Updates history for all elements of the simulation.  Should be used once per tick.  Called from go-function, if save-history? is true.

startup

to startup

Starts the hubnet functions

to go
Main function to run the simulation.
to degrade-all
Decreases all pay-offs by the global->global-agents-degradation vector for agents, nodes and edges.
vector, contains as much elements as the scenario has dimensions.
Hold the agents.
Hold the nodes.
Hold the edges.
to agents-run
Main function for all agent actions: Entering and leaving nodes and edges and taking decisions about the next node an agent wants to reach.
Holds the agents and information like the technology owned, actual state based on previous actions and variables used for calculate-utility (SEU calculation)
Hold the nodes’ information concerning their characteristics as well as actual values, indicating their state.
to update-history
Updates history for all elements of the simulation.
to startup
Starts the hubnet functions
Setup routines.
Contains all breed- and global-variables.
Helper functions.
Helper functions usable in simco only due to interface variables not present in the simco-net-generator.
Code for visual representation of the macro-layer
Code for visual representation of the macro-layer usable within simco, only.
This file contains visualiuation code for clients connected via hubnet.
Routines for the manual and automated control.
Handling all SEU functions, dealing with agent’s process of taking decisions.
Helper functions for input.
Handling all output helpers, p.e.
Helper functions to handle files and folders.
Helper functions to handle lists and sets.
Hold the technology objects.
Handling all interactions between agents, technologies and infrastructure elements (nodes and edges).
bool,
Close