Skip to content

Full realtime sim up and running #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: full-realtime-sim
Choose a base branch
from

Conversation

pabogdan
Copy link

Built upon your changes and tested that it works using the following script. Closing the simulation works in both in the case that you run sim.run(None) in a new thread and in the case that you have a different thread stopping the simulation.

import thread
import nengo
import numpy as np
import nengo_spinnaker
import time

model = nengo.Network(label="NetworkName")


with model:
    in_A = nengo.Node(output=np.sin)
    A = nengo.Ensemble(50, 1)
    out_A = nengo.Node(size_in=1)

    nengo.Connection(in_A, A)
    nengo.Connection(A, out_A)

sim = nengo_spinnaker.Simulator(model, period=None)


def sim_stop():
    global sim
    time.sleep(20)
    sim.stop()

thread.start_new_thread(sim_stop, ())
with sim:
    print "Sim inc"
    sim.run(None)
    print "Sim closed"

print "Board wiped"

@mundya mundya self-assigned this Aug 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants