Code Monkey home page Code Monkey logo

galapagos's Introduction

Galapagos

This is where our tortoise lives!

NetLogo Web (formerly known as "Tortoise") is a JavaScript-based version of NetLogo that runs entirely in the client's browser. This repository is for the Play application that serves up NetLogo Web pages.

Related is Teletortoise, which allows you to use your browser to interact with an instance of classic NetLogo that is running on a server. You can check out Teletortoise here.

For more information about the NetLogo Web project in general, see here.

galapagos's People

Contributors

adamhe17 avatar alizenart avatar camdenclark avatar daviddostal avatar diparthshah avatar drocks13 avatar fluffywaffles avatar garzon avatar idloj avatar kunal-mohta avatar lacuneta avatar mrerrormessage avatar nicolaspayette avatar qiemem avatar sethtisue avatar thebizzle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

galapagos's Issues

Procedures Defined in the Present Model Should Be Syntax Highlighted

Currently, Ace just looks at a static list of keywords in order to do the syntax highlighting.

In order to add this functionality, I think something needs to dynamically be done on code change to reach inside the Ace mode's tokenizer's syntax highlighter and change the keyword mapper to include keywords relevant to the current model (namely, the procedures).

Add button widgets

Teletortoise should read the button widgets from the loaded model, display them, and react accordingly when they are pressed. This is the first step in supporting widgets in general.

endless stream of empty view updates even when model is idle

even when nothing's happening, an endless stream of this is being sent over the websocket:

{"turtles":{},"patches":{}}
{"turtles":{},"patches":{}}
{"turtles":{},"patches":{}}
{"turtles":{},"patches":{}}
{"turtles":{},"patches":{}}
{"turtles":{},"patches":{}}
{"turtles":{},"patches":{}}
...

be clearer that any username will work

I've seen it over and over again where people think that to join the room they might need some special username, instead of just being fine to type any name

code should be in monospaced font

...while chatter should be in the regular sans serif font. this will help a lot with the usability problem where it's easy to lose track of whether you're chattering or commandcentering.

if the font distinction could show up in both the input field and in the output log, so much the better.

failure to `git submodule --init` to get models results in cryptic error

on the "stability" branch,

[error] application - 

! @6epf0mna9 - Internal server error, for (GET) [/model/list.json] ->

play.api.Application$$anon$1: Execution exception[[NullPointerException: null]]
        at play.api.Application$class.handleError(Application.scala:289) ~[play_2.10.jar:2.1.1]
        at play.api.DefaultApplication.handleError(Application.scala:383) [play_2.10.jar:2.1.1]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$17$$anonfun$apply$24.apply(PlayDefaultUpstreamHandler.scala:326) [play_2.10.jar:2.1.1]
        at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$17$$anonfun$apply$24.apply(PlayDefaultUpstreamHandler.scala:324) [play_2.10.jar:2.1.1]
        at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.1]
        at play.api.libs.concurrent.PlayPromise$$anonfun$extend1$1.apply(Promise.scala:113) [play_2.10.jar:2.1.1]
java.lang.NullPointerException: null
        at scala.collection.mutable.ArrayOps$ofRef$.newBuilder$extension(ArrayOps.scala:109) ~[scala-library.jar:na]
        at scala.collection.mutable.ArrayOps$ofRef.newBuilder(ArrayOps.scala:105) ~[scala-library.jar:na]
        at scala.collection.TraversableLike$class.filter(TraversableLike.scala:262) ~[scala-library.jar:na]
        at scala.collection.mutable.ArrayOps$ofRef.filter(ArrayOps.scala:105) ~[scala-library.jar:na]
        at controllers.Application$$anonfun$modelList$1.controllers$Application$$anonfun$$recursiveListFiles$1(Application.scala:29) ~[na:na]
        at controllers.Application$$anonfun$modelList$1$$anonfun$1.apply(Application.scala:33) ~[na:na]

eventually I figured out I needed to git submodule --init, but it'd be nice if I got a reasonable error, and/or if the "building/running" instructions included the necessary extra step

Improve netlogo command request-response protocol

Currently, the protocol consists of sending a command to the server. You then get a response that contains either the output that would've been printed to the command center printed or an error. This response is not traceable back to the original request.

The protocol should support:

  • Support for reporters.
  • Tracing responses back to their original request. It should be the actual, unique request. So, it should be done on a unique id, not just the request contents. This is absolutely necessary for reporters.
  • Distinct "error" and "success" response. Success responses should contain the reporter result / command output.
  • Possibly separate "success" response types for reporters and commands. I don't think so though. I was originally envisioning this, so I don't want to discard it completely.
  • Responses for print "" and crt 5 should be distinguishable. I'm happy to use null for this, since we literally want to say "there was no output", but I could be persuaded otherwise (leave out the key entirely?). Some equivalent of Option would be cool, but seems like overkill.

alternate view showing just NetLogo model

It would be very useful to me to have an alternate view that just shows the NetLogo model and supports a JavaScript API for communicating with the model.

I'd like to see if I can create a prototype where I can embed the result of this in an iframe on another page. Then I'd like to experiment with a postMessage API to communicate with the Teletortise model running in the iframe.

We have recently experimented with this in the Lab repo by embedding an html5 NextGen MW Interactive into a Khan exercise.

See demo here showing the Khan "Check Answer" button using a postMessage-based API in the Khan exercise to find out the "Pressure" from the embedded html5 NextGen MW model running in the iframe.

http://concord-consortium.github.com/khan-exercises/exercises/volume_pressure_relationship.html

More details on how we are experimenting with a postMessage API:

email list: lab-models
thread: Lab + Khan exercise demo
https://groups.google.com/group/lab-models/browse_thread/thread/90c6ea2d1d72d14c

This is the the only file added/changes made in the Khan exercise framework to support this:

https://github.com/concord-consortium/khan-exercises/blob/concord-demo/exercises/volume_pressure_relationship.html

These are the two new files added to Lab to support this level of communication:

The more generic controller for supporting the postMessage API:

https://github.com/concord-consortium/lab/blob/master/src/lab/md2d/controllers/parent-message-api.js

And a more specific one that is used to specifically support the 2D Molecular Dynamics model:
https://github.com/concord-consortium/lab/blob/master/src/lab/common/parent-message-controller.js

view not updated properly after entering commands in Observer

Testing with the Global Climate model running:

observer: setup
observer: loop [ go ]
observer: add-cloud
observer: add-cloud
observer: add-cloud

No clouds appear.

chatter: /halt

Clouds have appeared.

Perhaps the following is the same issue:

observer: setup
observer: loop [ go ]

At this point some of the "sunlight" is being reflected from the Earth

observer: set albedo 0

The model continues as before -- I expected no sunlight to be reflected.

chatter: /halt
observer: loop [ go ]

Now view is updated.

Support directed links and link shapes

Link shapes determine how directed links are shown, thus I have combined these two features into one issue.

It might be best to do this in stages:

  1. Support direction indicator
  2. Support curviness
  3. Support multi-line links

colors are too saturated

the colors are more neon than the actual NetLogo colors

we seem to be using the right RGB values, so I don't know if this is because the browser is doing some kind of gamma correction or what.

Safari, Firefox, Chrome, all same. this is on Mac OS X

Screen Shot 2012-12-12 at 12 25 45 PM

Stop `go`ing Forever If No One Is in the Room

Some wise-ass decided to do /go and then leave the room without stopping it. This left the server running at full CPU usage for over three hours, and, is, thus, not cool. /go should automatically turn itself off if no one—barring BizzleBot—is in the room.

render lines correctly in shapes

in NetLogo/Teletortoise@83701ed I did a janky version of this where we render a rectangle instead of a line, which was enough for Climate Change to look sort of reasonable, but of course isn't right at all

before resorting to the rectangle thing, I did try using various combinations of lineTo and stuff but nothing ever got drawn

Syntax Highlighting Might Be Desirable in the Command Center Output

Now that we have syntax highlighting in the input box, it might seem desirable to have coloring in the command center output. There are two things that complicate that at the moment:

  • The input box and the chat outputs are (purposely) styled very differently. Currently, the black (default) text color looks fine in the (white) input box, but would be very difficult to read against the (dark gray) background of the Command Center output entries.
  • As far as I've been able to tell, getting the Ace-highlighted HTML requires creating an HTML element, turning it into an Ace element through JavaScript, and making it visible at least for a brief moment in order to force the initialization of the Ace element.

Some planning of how to circumvent these problems should be done before attempting to syntax color output code.

deprecation warnings after switching to Play 2.1

[warn] /Users/tisue/teletortoise/app/models/WebInstance.scala:79: class PushEnumerator in package iteratee is deprecated: use Concurrent.broadcast instead
[warn]   private type MemberValue = PushEnumerator[JsValue]
[warn]                              ^
[warn] /Users/tisue/teletortoise/app/models/WebInstance.scala:81: class PushEnumerator in package iteratee is deprecated: use Concurrent.broadcast instead
[warn]   val members = MutableMap.empty[MemberKey, MemberValue]
[warn]       ^
[warn] /Users/tisue/teletortoise/app/models/WebInstance.scala:91: method imperative in object Enumerator is deprecated: use Concurrent.broadcast instead
[warn]       val channel = Enumerator.imperative[JsValue](onStart = () => room ! NotifyJoin(username))
[warn]                                ^
[warn] /Users/tisue/teletortoise/app/models/WebInstance.scala:131: class PushEnumerator in package iteratee is deprecated: use Concurrent.broadcast instead
[warn]   class Pushable[T <: Iterable[MemberTuple]](foreachable: T) {
[warn]                       ^

Support UI for selecting from available NetLogo models

It would be useful to expose a selection list in the UI for a user to select from the NetLogo models in the ./public/models dir:

https://github.com/NetLogo/Teletortoise/tree/master/public/models

Currently "Wolf Sheep Predation" is hard-coded into NetLogoController.scala:

https://github.com/NetLogo/Teletortoise/blob/master/app/models/NetLogoController.scala#L17

I would like to demo the Global Climate model running in Teletortise to remote collaborators so being able to do this on deployed demo server would be useful:

http://li425-91.members.linode.com:9000/

Add a simple authoring tool

Add a simple text editor that shows the code of the current model and that, when edited, sends the code back to the server to either be compiled and sent back as js (tortoise), or compiled and incorporated in the workspace (teletortoise).

I'm going to use Ace for now as we have working syntax highlighting for that. Swapping out text editors would be trivial in the future though.

/halt not halting

I'm on Teletortoise on Linode, running the Life model, and /halt isn't halting the model. BizzleBot says "@seth, halting" but it doesn't. (even after several minutes and multiple attempts)

security is, ahem, an issue

I shouldn't be able to do stuff like file-open "/etc/passwd" repeat 100 [ print file-read-line ] and so forth.

maybe install a SecurityManager?

side-by-side Tortoise & Teletortoise UI with shared command center

I think this would be fun/useful to have for testing/demo purposes. I'd type the same command once in the shared command center and then it would run in both T and TT and could eyeball whether the results were the same on both sides.

I might do a Swing version of this for doing similar Tortoise/NetLogo comparisons

(Jason suggested I open a ticket)

Make links respect topology

Right now, links don't take advantage of wrapping. They should follow the wrapped path if that happens to be the shortest path.

Indexing of Context List Is Broken

ctrl+shift+1 used to put you into the "chatter" context. It now puts you into "turtles". I suspect that this is the result of someone tinkering with LinkedHashSet.

Tortoise: killing turtles doesn't make them disappear

but the tests in TestTortoise seem to show that the correct JSON is being generated when turtles die, so unless there's something wrong with the testing framework, this seems like a bug in the Tortoise/Teletortoise front end

Tortoise Currently Fails to Draw Shapes

To reproduce:

  • Go to Tortoise
  • Type setup into the Command Center
  • Observe as nothing happens, rendering Tortoise entirely useless

The above causes an error to be thrown by this line (in JavaScript):

shape = this.drawer.shapes[shapeName] || defaultShape;

as a result of shapes being undefined.

git bisect incriminates 26c83cc as the culprit.

Note: In the future, please test on both Teletortoise and Tortoise before checking in significant changes to core systems.

Add entire models library to Teletortoise

Uri requested this in a meeting. Now that Teletortoise can at least sensibly display something for every model (that doesn't use the drawing layer), it might make sense to just put them all in.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.