Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "STEM Import Discrete Transportation Events"

(Import the Pajek Graph)
(Configure the GraphMapView (1))
 
(19 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
== The Pajek File ==
 
== The Pajek File ==
  
The following text must be copied into a new textfile named '''graph.net'''. In the Vertices* section node references are specified for '''AT-2, AT-3, ... AT-10'''. These are nodes from the STEM library graph of Austria. In the Edges* section migration edges between these nodes are defined. The edges have default migration rate of zero and a rate >0 for a specified date. That means only a this date beef moves from one region to another.
+
The following text must be copied into a new textfile named '''graph.net'''. In the Vertices* section node references are specified for '''AT-2, AT-3, ... AT-10'''. These are nodes from the STEM library graph of Austria. In the Edges* section migration edges between these nodes are defined. The edges have default migration rate of zero and a rate >0 for a specified date. That means on this particular date beef moves from one region to another.
  
 
  *Vertices 9
 
  *Vertices 9
Line 53: Line 53:
 
  8 9 popID beef rate 0 date 2012-01-08 rate 80.0
 
  8 9 popID beef rate 0 date 2012-01-08 rate 80.0
  
== Create a new Project ==
+
== Create a New Project ==
  
 
[[Image:STEM_DiscreteImport_CreateProject.png]]
 
[[Image:STEM_DiscreteImport_CreateProject.png]]
  
== Create a new Model ==
+
== Create a New Model ==
 
This model is created as a container for all graphs used in this tutorial.
 
This model is created as a container for all graphs used in this tutorial.
  
 
[[Image:STEM_DiscreteImport_CreateModel.png]]
 
[[Image:STEM_DiscreteImport_CreateModel.png]]
  
== Drag the Austria Geography Model into the new Model ==
+
== Drag the Austria Geography Model into the New Model ==
  
 
[[Image:STEM_DiscreteImport_DragAustriaToModel.png]]
 
[[Image:STEM_DiscreteImport_DragAustriaToModel.png]]
Line 71: Line 71:
 
[[Image:STEM_DiscreteImport_ImportPajek.png]]
 
[[Image:STEM_DiscreteImport_ImportPajek.png]]
  
== Drag the imported Graph into the Model ==
+
== Drag the Imported Graph into the Model ==
  
 
[[Image:STEM_DiscreteImport_DragPajekToModel.png]]
 
[[Image:STEM_DiscreteImport_DragPajekToModel.png]]
  
 
== Create a Population Initializer ==
 
== Create a Population Initializer ==
 +
 +
The population initializer is needed for initializing the regions from the Austria with the population beef. Each region is initialized with 1000 units of beef.
  
 
[[Image:STEM_DiscreteImport_CreateInitializer.png]]
 
[[Image:STEM_DiscreteImport_CreateInitializer.png]]
Line 83: Line 85:
 
[[Image:STEM_DiscreteImport_DragInitializerToModel.png]]
 
[[Image:STEM_DiscreteImport_DragInitializerToModel.png]]
  
== Create a new Scenario ==
+
== Create a New Scenario ==
  
 
[[Image:STEM_DiscreteImport_CreateScenario.png]]
 
[[Image:STEM_DiscreteImport_CreateScenario.png]]
Line 91: Line 93:
 
[[Image:STEM_DiscreteImport_DragModelToScenario.png]]
 
[[Image:STEM_DiscreteImport_DragModelToScenario.png]]
  
== Drag the Trigger (was created during Pajek Import) to the Scenario ==
+
== Drag the Trigger (created during Pajek Import) to the Scenario ==
 +
 
 +
The trigger was automatically created during the Pajek-Import step. It contains the time dependent migration rates.
  
 
[[Image:STEM_DiscreteImport_DragTriggerToScenario.png]]
 
[[Image:STEM_DiscreteImport_DragTriggerToScenario.png]]
  
 
== Create a Sequencer ==
 
== Create a Sequencer ==
 +
 +
Since the dates in the Pajek file are the first 8 days of 2012, our Sequencer will start on December 31st 2011.
  
 
[[Image:STEM_DiscreteImport_CreateSequencer.png]]
 
[[Image:STEM_DiscreteImport_CreateSequencer.png]]
Line 103: Line 109:
 
[[Image:STEM_DiscreteImport_DragSequencerToScenario.png]]
 
[[Image:STEM_DiscreteImport_DragSequencerToScenario.png]]
  
== Create a Population Model for beef ==
+
== Create a Population Model for Beef ==
 +
 
 +
In STEM there has to be a population model for each population. We just set the birth and death rates to zero.
  
 
[[Image:STEM_DiscreteImport_CreatePopulationModel.png]]
 
[[Image:STEM_DiscreteImport_CreatePopulationModel.png]]
Line 112: Line 120:
  
 
== Start the Simulation ==
 
== Start the Simulation ==
 +
 +
We have finished creating the Scenario. Now we can start the Simulation. We press the '''step''' button to perform the initial step.
  
 
[[Image:STEM_DiscreteImport_StartSimulation.png]]
 
[[Image:STEM_DiscreteImport_StartSimulation.png]]
  
 
== Configure the GraphMapView (1) ==
 
== Configure the GraphMapView (1) ==
 +
 +
We need to select the Trigger using the upper left combo box. This colors regions based on the number of beef units already transported to the regions. If we select '''Migration (Triggered)''' in the '''Edges''' combo box, all migration edges with rates >0 at the current date are shown.
  
 
[[Image:STEM_DiscreteImport_ConfigureSimulation1.png]]
 
[[Image:STEM_DiscreteImport_ConfigureSimulation1.png]]
  
 
== Configure the GraphMapView (2) ==
 
== Configure the GraphMapView (2) ==
 +
 +
Now we set the '''Gain Factor''' in the context menu to 0.001. This factor scales the red coloration of the regions.
  
 
[[Image:STEM_DiscreteImport_ConfigureSimulation2.png]]
 
[[Image:STEM_DiscreteImport_ConfigureSimulation2.png]]
  
 
== Run the Simulation Step by Step ==
 
== Run the Simulation Step by Step ==
 +
 +
Now you can run the simulation step by step by pressing the step button.
  
 
[[Image:STEM_DiscreteImport_RunSimulation.png]]
 
[[Image:STEM_DiscreteImport_RunSimulation.png]]

Latest revision as of 14:38, 17 August 2012

This tutorial shows how to import the discrete transporation events from a Pajek file and visualize the events. Documentation on the Pajek format is available at Importing a Pajek Graph. The import of transportation data of beef for Austria is used as an example here.

The Pajek File

The following text must be copied into a new textfile named graph.net. In the Vertices* section node references are specified for AT-2, AT-3, ... AT-10. These are nodes from the STEM library graph of Austria. In the Edges* section migration edges between these nodes are defined. The edges have default migration rate of zero and a rate >0 for a specified date. That means on this particular date beef moves from one region to another.

*Vertices 9
1 AT-10
2 AT-2
3 AT-3
4 AT-4
5 AT-5
6 AT-6
7 AT-7
8 AT-8
9 AT-9
*Edges
1 2 popID beef rate 0 date 2012-01-01 rate 10.0
1 3 popID beef rate 0 date 2012-01-01 rate 10.0
1 4 popID beef rate 0 date 2012-01-01 rate 10.0
1 5 popID beef rate 0 date 2012-01-01 rate 10.0
1 6 popID beef rate 0 date 2012-01-01 rate 10.0
1 7 popID beef rate 0 date 2012-01-01 rate 10.0
1 8 popID beef rate 0 date 2012-01-01 rate 10.0
1 9 popID beef rate 0 date 2012-01-01 rate 10.0
2 3 popID beef rate 0 date 2012-01-02 rate 20.0
2 4 popID beef rate 0 date 2012-01-02 rate 20.0
2 5 popID beef rate 0 date 2012-01-02 rate 20.0
2 6 popID beef rate 0 date 2012-01-02 rate 20.0
2 7 popID beef rate 0 date 2012-01-02 rate 20.0
2 8 popID beef rate 0 date 2012-01-02 rate 20.0
2 9 popID beef rate 0 date 2012-01-02 rate 20.0
3 4 popID beef rate 0 date 2012-01-03 rate 30.0
3 5 popID beef rate 0 date 2012-01-03 rate 30.0
3 6 popID beef rate 0 date 2012-01-03 rate 30.0
3 7 popID beef rate 0 date 2012-01-03 rate 30.0
3 8 popID beef rate 0 date 2012-01-03 rate 30.0
3 9 popID beef rate 0 date 2012-01-03 rate 30.0
4 5 popID beef rate 0 date 2012-01-04 rate 40.0
4 6 popID beef rate 0 date 2012-01-04 rate 40.0
4 7 popID beef rate 0 date 2012-01-04 rate 40.0
4 8 popID beef rate 0 date 2012-01-04 rate 40.0
4 9 popID beef rate 0 date 2012-01-04 rate 40.0
5 6 popID beef rate 0 date 2012-01-05 rate 50.0
5 7 popID beef rate 0 date 2012-01-05 rate 50.0
5 8 popID beef rate 0 date 2012-01-05 rate 50.0
5 9 popID beef rate 0 date 2012-01-05 rate 50.0
6 7 popID beef rate 0 date 2012-01-06 rate 60.0
6 8 popID beef rate 0 date 2012-01-06 rate 60.0
6 9 popID beef rate 0 date 2012-01-06 rate 60.0
7 8 popID beef rate 0 date 2012-01-07 rate 70.0
7 9 popID beef rate 0 date 2012-01-07 rate 70.0
8 9 popID beef rate 0 date 2012-01-08 rate 80.0

Create a New Project

STEM DiscreteImport CreateProject.png

Create a New Model

This model is created as a container for all graphs used in this tutorial.

STEM DiscreteImport CreateModel.png

Drag the Austria Geography Model into the New Model

STEM DiscreteImport DragAustriaToModel.png

Import the Pajek Graph

The Pajek file must contain the text from The Pajek File.

STEM DiscreteImport ImportPajek.png

Drag the Imported Graph into the Model

STEM DiscreteImport DragPajekToModel.png

Create a Population Initializer

The population initializer is needed for initializing the regions from the Austria with the population beef. Each region is initialized with 1000 units of beef.

STEM DiscreteImport CreateInitializer.png

Drag the Initializer into the Model

STEM DiscreteImport DragInitializerToModel.png

Create a New Scenario

STEM DiscreteImport CreateScenario.png

Drag the Model into the Scenario

STEM DiscreteImport DragModelToScenario.png

Drag the Trigger (created during Pajek Import) to the Scenario

The trigger was automatically created during the Pajek-Import step. It contains the time dependent migration rates.

STEM DiscreteImport DragTriggerToScenario.png

Create a Sequencer

Since the dates in the Pajek file are the first 8 days of 2012, our Sequencer will start on December 31st 2011.

STEM DiscreteImport CreateSequencer.png

Drag the Sequencer into the Scenario

STEM DiscreteImport DragSequencerToScenario.png

Create a Population Model for Beef

In STEM there has to be a population model for each population. We just set the birth and death rates to zero.

STEM DiscreteImport CreatePopulationModel.png

Drag the Population Model into the Scenario

STEM DiscreteImport DragPopulationModelToScenario.png

Start the Simulation

We have finished creating the Scenario. Now we can start the Simulation. We press the step button to perform the initial step.

STEM DiscreteImport StartSimulation.png

Configure the GraphMapView (1)

We need to select the Trigger using the upper left combo box. This colors regions based on the number of beef units already transported to the regions. If we select Migration (Triggered) in the Edges combo box, all migration edges with rates >0 at the current date are shown.

STEM DiscreteImport ConfigureSimulation1.png

Configure the GraphMapView (2)

Now we set the Gain Factor in the context menu to 0.001. This factor scales the red coloration of the regions.

STEM DiscreteImport ConfigureSimulation2.png

Run the Simulation Step by Step

Now you can run the simulation step by step by pressing the step button.

STEM DiscreteImport RunSimulation.png

Copyright © Eclipse Foundation, Inc. All Rights Reserved.