Symbulation Lab
Goals
To get familiar with Symbulation’s sgp-mode and be prepared to start the assignment.
Setup
You’ll be working directly in your repository for the Digital Evolution assignment, so hopefully you already have it cloned down. If not, go through the set up steps in there.
Exercise 1
Adding a task to Symbulation is similar in idea to the SGP-Lite lab, though the specific syntax surrounding the logic is slightly different.
-
While you could make a new task set, it’s easiest to just add to the
LogicTaskSetand fine to do so for this assignment. Open upsource/sgp_mode/tasks/LogicTaskSet.hand find the setpredefined_tasks. -
You can see that these tasks are still taking in
inputsand returning auint32_t. For organization sake, the existing task logic is all defined inboolean_logic_impls.h, and you could add yours there, but you can also just have it right in place here. Copy one of the existing tasks and change it to be called SQUARE. -
Instead of returning the result of calling the logic function, change to returning
inputs[0] * inputs[0]. (The task infrastructure handles rotating through the possible inputs, so you don’t have to worry about that, you just have to define the task for one input value. It also handles making sure that 0 doesn’t solve the task.) -
While you can make a new task environment configuration file, it’ll be easiest for now to change the the one currently being used in
default-config-jsonsto include your new SQUARE task. Give it whatever reward you want! -
Make sure that your code runs in the terminal version by running
make sgp-modeand then./symbulation_sgp. Check inData/Tasks_data.csvand make sure that your new task has a column showing.
Exericse 2
Let’s have your new task show up in the GUI.
-
Open
web/SGPSymAnimate.h. -
Edit
task_mapandmatchColorto have your task show a new color -
Make sure you can compile and see your new task with
./compile-run-web.sh
Exercise 3
You can also add new events to Symbulation.
Follow this guide section to create an event that just prints out “Event happened!” every 100 updates.
Remember to compile and run to make sure that your event is working as expected.
Exericse 4
Work through the Collecting and Analyzing sections of the Quickstart guides for some data in your files. You’ll need to update the scripts in the stats_scripts folder to work for some data that you have. I recommend analyzing the file CurrentUpdateInfo_data.csv and the 1th column host_mean_generations just to get used to plotting data.
Keep going
You’re pretty well set to explore different functionality and make progress on the homework. In class is a great time to ask about specific functionality that you are interested in!