NetLogo/NetLogo — Issue #35: some SDM models behave incorrectly when running headless
Author: SethTisue
Created: 2011-11-22 22:53:53+00:00
State: open

Kevin Zollman supplied the example System Dynamics Modeler diagram below.

in the GUI, this is read in by JHotDraw, which handles it correctly. but we can't use JHotDraw from org.nlogo.headless, so we rolled our own code in `sdm.AggregateManagerLite` to read SDM diagrams, and that code fails on this case.

NetLogo 4.1 has the same issue.

```text
0.01
org.nlogo.sdm.gui.AggregateDrawing 9
org.nlogo.sdm.gui.ConverterFigure "attributes" "attributes" 1 "FillColor" "Color" 130 188 183 242 296 50 50
org.nlogo.sdm.gui.WrappedConverter "type-1 + ( type-2 * 3)" "type-1-fitness"
org.nlogo.sdm.gui.ConverterFigure "attributes" "attributes" 1 "FillColor" "Color" 130 188 183 369 293 50 50
org.nlogo.sdm.gui.WrappedConverter "type-2 * 2" "type-2-fitness"
org.nlogo.sdm.gui.StockFigure "attributes" "attributes" 1 "FillColor" "Color" 225 225 182 177 107 60 40
org.nlogo.sdm.gui.WrappedStock "type-1" "0.01" 0
org.nlogo.sdm.gui.StockFigure "attributes" "attributes" 1 "FillColor" "Color" 225 225 182 479 108 60 40
org.nlogo.sdm.gui.WrappedStock "type-2" "0.99" 0
org.nlogo.sdm.gui.ConverterFigure "attributes" "attributes" 1 "FillColor" "Color" 130 188 183 501 286 50 50
org.nlogo.sdm.gui.WrappedConverter "(type-1 * type-1-fitness) + (type-2 * type-2-fitness)" "ave-fitness"
org.nlogo.sdm.gui.ReservoirFigure "attributes" "attributes" 1 "FillColor" "Color" 192 192 192 103 101 30 30
org.nlogo.sdm.gui.RateConnection 3 133 117 149 119 165 121 NULL NULL 0 0 0
org.jhotdraw.figures.ChopEllipseConnector REF 11
org.jhotdraw.standard.ChopBoxConnector REF 5
org.nlogo.sdm.gui.WrappedRate "type-1 * (type-1-fitness - ave-fitness)" "t1-replicator"
org.nlogo.sdm.gui.WrappedReservoir REF 6 0
org.nlogo.sdm.gui.ReservoirFigure "attributes" "attributes" 1 "FillColor" "Color" 192 192 192 396 110 30 30
org.nlogo.sdm.gui.RateConnection 3 426 125 446 125 467 126 NULL NULL 0 0 0
org.jhotdraw.figures.ChopEllipseConnector REF 17
org.jhotdraw.standard.ChopBoxConnector REF 7
org.nlogo.sdm.gui.WrappedRate "type-2 * (type-2-fitness - ave-fitness)" "t2-replicator"
org.nlogo.sdm.gui.WrappedReservoir REF 8 0
```

in the generated code, in `system-dynamics-go` in the GUI we see:

```text
let new-type-1 ( type-1 + local-t1-replicator )
let new-type-2 ( type-2 + local-t2-replicator )
```

but from headless (adding `println(source)` to `AggregateManagerLite.load` and running `headless.Main` with `run --model /Users/tisue/Desktop/PD-replicator.nlogo --experiment experiment`) we see:

```text
let new-type-1 ( type-1 + local-t1-replicator )
let new-type-2 ( type-2 )
```