ValidatorClient is the software running the validator, making messages, etc. It inherits from Thread so it can be run in as a thread, executing it's run method, or it can just run as a regular object.
Now two types of simulations: single-threaded and multi-threaded. Can be specified when running casper.py via --simulator
Notes on multi-threaded args:
--rounds is the number of seconds to run
--report-interval is how often to graph frames in seconds
--rounds 60 --report-interval 1 will run a simulation of 60 seconds and create an output frame to the gif at every 1 second interval.
--hide-display is unnecessary. Does not hve the ability to do a tkinter display during running
--save True saves the gif
Clock is a dumb interface to time for our objects. A clock relies on some external actor to update it's time. In the single-threaded simulation, the simulation-runner updates it explicitly, because the sim-runner is the central coordinator. In the multi-threaded simulation, the ValidatorClient thread updates its own clock each time it goes through its run loop.
More thoughts on timing: Currently, ValidatorClient's update their Clock with process_time which makes these clocks not particularly interesting because all the threads share the same process_time. Need to look into alternative timing mechanisms. Threads are only somewhat interesting anyway. More exciting would be to have components in their own process...
Message strategies are currently just monkey patched into ValidatorClients should_make_new_message method, but I'd like to move to specifying a more generic Strategy class that is passed to the ValidatorClient and encapsulates the logic of when to make a message
Things:
ValidatorClient
is the software running the validator, making messages, etc. It inherits fromThread
so it can be run in as a thread, executing it'srun
method, or it can just run as a regular object.--simulator
--rounds
is the number of seconds to run--report-interval
is how often to graph frames in seconds--rounds 60 --report-interval 1
will run a simulation of 60 seconds and create an output frame to the gif at every 1 second interval.--hide-display
is unnecessary. Does not hve the ability to do a tkinter display during running--save True
saves the gifClock
is a dumb interface to time for our objects. A clock relies on some external actor to update it's time. In the single-threaded simulation, the simulation-runner updates it explicitly, because the sim-runner is the central coordinator. In the multi-threaded simulation, the ValidatorClient thread updates its own clock each time it goes through itsrun
loop.process_time
which makes these clocks not particularly interesting because all the threads share the sameprocess_time
. Need to look into alternative timing mechanisms. Threads are only somewhat interesting anyway. More exciting would be to have components in their own process...should_make_new_message
method, but I'd like to move to specifying a more generic Strategy class that is passed to the ValidatorClient and encapsulates the logic of when to make a messageThreaded simulation sample run:
TODO: