Simco-Net-generator.nlogo

Gives a handy tool with a little interface to generate networks.

Extensions

tablehelpers for tables
arrayhelpers for arrays

Includes

libs/helpers.nlsMany helpers (used in main project, too): libs/helpers.nls
Summary
Simco-Net-generator.nlogoGives a handy tool with a little interface to generate networks.
globalsHold same global vars.
nodesHold the nodes.
edgesHold the edges.
agentsHold the agents.
technologiesHold the technology objects.
choose-directoryLet the user choose a directory.
generateGenerates a network with technologies, nodes, edges and agents.
generate-technologiesGenerates technologies for the network.
generate-nodesGenerates nodes for the network.
generate-edgesGenerates edges for the network.
generate-agentsGenerates agents for the network.
save-networkWrites out the network into 6 files.
layoutTake a nice layout for the nodes.

globals

Hold same global vars.

Variables

diruser chosen directory
tech-file???
number-dimensionssecurity copy of number-of-dimensions
inspect?(resolves conflicts with libs/helpers.nls)
log-level(resolves conflicts with libs/helpers.nls)
edge-costs-benefits-agents-control-factor(resolves conflicts with libs/helpers.nls)
node-costs-benefits-agents-control-factor(resolves conflicts with libs/helpers.nls)

nodes

Hold the nodes.

Variables

node-idId (“who” is used for all breeds, thus for nodes as well as for agents)
node-lifetimeLifetime
node-agents-listlists all agents that are at the node
node-historyHistory
node-right-of-use2D array of technologies and a flag for each if it could be used
node-limits-short-timeshort time limits for all dimensions
node-limits-long-timelong time limits for all dimensions
node-degree-short-timeactual load over short time for all dims
node-degree-long-timeactual load over long time for all dims
node-costs-benefits-nodeslist, contains values for different dimensions
node-costs-benefits-agentslist, contains values for different dimensions
node-costs-benefits-externallist, contains values for different dimensions
node-pay-offs-long-timerepresents the actual values of the node (different dimension), calculated by use of costs-benefits-nodes and usage of the node by agents.
node-pay-offs-short-timesee node-pay-offs-long-time at nodes

edges

Hold the edges.

Variables

edge-lifetimeLifetime
edge-agents-listlists all agents that are at the edge
edge-historyHistory
edge-right-of-usevector: technology + boolean, indicating if the technology may be used to pass the edge (true) or if it is forbidden to use (false)
edge-limits-short-timesee node-limits-short-time at nodes
edge-limits-long-timesee node-limits-long-time at nodes
edge-degree-short-timesee node-degree-short-time at nodes
edge-degree-long-timesee node-degree-long-time at nodes
edge-durationtime needed (in number of ticks) to pass the edge, > 0 ticks
edge-costs-benefits-edgeslist, contains values for different dimensions
edge-costs-benefits-agentslist, contains values for different dimensions
edge-costs-benefits-externallist, contains values for different dimensions
edge-pay-offs-short-timerepresents the actual values of the edge (different dimension), calculated by use of edge-costs-benefits-edges and usage of the edge by agents.
edge-pay-offs-long-timesee edge-pay-offs-short-time at edges
overcrowded?gets true if edge is overcrowded

agents

Hold the agents.

Variables

agent-id”who” is used for all breeds, thus for nodes as well as for agents.
agent-locationagent is on a node or an edge
agent-destinationthe next node an agents wants to go to.
agent-edge-delaythe time left that the agent needs to pass the edge
agent-limits-short-timesee node-limits-short-time at nodes
agent-limits-long-timesee node-limits-long-time at nodes
agent-pay-offsrepresents the actual values of the agent (different dimension), calculated by use of edge-costs-benefits-agents (edges) and costs-benefits-agents (on nodes).
agent-technologies-availablebuyed technologies
agent-technology-in-useactually used technology
agent-typethe type of agent, with regard to weighting of aims etc.

technologies

Hold the technology objects.

Variables

technology-idId
technology-nameName
technology-purchase-pricepurchase Price
technology-lifetimeLifetime (technology unusable when time is passed (starts at the moment an agent purchases the technology, value decreased each tick))
technology-factorFactor (used to calculate costs and benefits, by map-multiplication with cost-benefits-vectors of nodes/edges)
Summary
choose-directoryLet the user choose a directory.
generateGenerates a network with technologies, nodes, edges and agents.
generate-technologiesGenerates technologies for the network.
generate-nodesGenerates nodes for the network.
generate-edgesGenerates edges for the network.
generate-agentsGenerates agents for the network.
save-networkWrites out the network into 6 files.
layoutTake a nice layout for the nodes.

choose-directory

to choose-directory

Let the user choose a directory.  Directory chooser opens at subdir “networks”.  Chosen directory will be saved at “dir”.

generate

to generate

Generates a network with technologies, nodes, edges and agents.

generate-technologies

to generate-technologies

Generates technologies for the network.  All technology-factors are set to 1.

Parameters

number-of-technologiesNumber of technologies (defined per user interface)

generate-nodes

to generate-nodes

Generates nodes for the network.  All technologies are set to be allowed.

Parameters

number-of-nodesNumber of nodes (defined per user interface)
mean-node-lifetimeMean value for node lifetime (defined per user interface)
deviation-node-lifetimeDeviation for node lifetime (defined per user interface)
upper-node-limits-short-time...

generate-edges

to generate-edges

Generates edges for the network.  From and to node are randomly choose.  All technologies are set to be allowed.

Parameters

number-of-edgesNumber of edges (defined per user interface)
mean-edge-lifetimeMean value for edge lifetime (defined per user interface)
deviation-edge-lifetimeDeviation for edge lifetime (defined per user interface)
upper-edge-limits-short-time...

generate-agents

to generate-agents

Generates agents for the network.  Destination will be set to -1 (no destination).  Used technology will be randomly chosen.

Parameters

number-of-agentsNumber of agents (defined per user interface)
upper-agent-limits-short-time...

save-network

to save-network

Writes out the network into 6 files.  All file names start with the network name.

layout

to layout

Take a nice layout for the nodes.

to choose-directory
Let the user choose a directory.
to generate
Generates a network with technologies, nodes, edges and agents.
to generate-technologies
Generates technologies for the network.
to generate-nodes
Generates nodes for the network.
to generate-edges
Generates edges for the network.
to generate-agents
Generates agents for the network.
to save-network
Writes out the network into 6 files.
to layout
Take a nice layout for the nodes.
Helper functions.
Hold the nodes.
Hold the edges.
Close