NetLogo / HubNet-Webapp

A webapp that manages HubNet activities on a server.
4 stars 1 forks source link

Disease model requires that the startup procedure is called from the headless launcher script #8

Open lukas-shawford opened 13 years ago

lukas-shawford commented 13 years ago

Currently, netlogo/RunHeadless.java calls the activity's startup procedure in order to fix this problem:

When running the Disease model headlessly and try to connect, I get this error:

MEMBER? expected input to be a string or list or agentset but got the number 0 instead. error while student 0 running MEMBER? called by procedure SET-UNIQUE-SHAPE-AND-COLOR called by procedure SETUP-STUDENT-VARS called by procedure CREATE-NEW-STUDENT called by procedure LISTEN-CLIENTS called by procedure GO called by procedure __EVALUATOR

This happens because used-shape-colors didn't get initialized. It only gets initialized if the startup procedure gets called.

However, the startup procedure is meant to be GUI-only:

https://trac.assembla.com/nlogo/ticket/1202

Calling startup seems not to affect the other HubNet activities included in the models library, so I'm leaving it in there for now, but there may be issues with other models later on.

joshcough commented 13 years ago

It looks like adding it to RunHeadless.java isn't a problem. If you've tested it with models that don't have a startup procedure, and they still work, then I think this is the best way to go about it.

One thing we will need to do though, is document what things are and aren't legal from models run in this way (such as forever buttons not being supported). Another thing we should do is change some of the models to get rid of the forever buttons, replacing them with a "on" switch. I am putting this comment here because its sort of related. We may need to document that startup is always run from RunHeadless.java, and what that means to the user.