Skip to content

EEGo-UNC/BaaS

Repository files navigation

BaaS

BaaS is a simulation framework for testing neuroadaptive game difficulty in Tetris. The system models how EEG-like emotion classifications can drive adaptive controllers that change game speed during play.

The current project focuses on three simulated users:

User Short label Skill profile
Frustrated Freddy FF Beginner
Average Amy AA Intermediate
Hairy Henry HH Advanced

The current experiment setup uses:

Component Current options
Controllers PID, Feedforward
Classifiers SpeedOnly, Noisy
Target emotion HAHV

Run the main experiment

The main experiment searches over PID and Feedforward controller parameters, then keeps only the best configuration for each user/controller/classifier condition.

python experiment.py

Main output will go to the experiment_results folders.

Emotion distribution from the best controller settings

Predicted emotion distribution

Short labels:

Label Meaning
FF Frustrated Freddy
AA Average Amy
HH Hairy Henry
PID PID controller
ff Feedforward controller
SO SpeedOnly classifier
N Noisy classifier

Example: AA-ff-SO means Average Amy + Feedforward + SpeedOnly.


Run the delayed experiment

The delayed experiment tests robustness when the control loop is delayed.

It varies two delay values:

Delay Meaning
Controller delay The controller receives an older classifier probability vector
User-change delay The user's emotional state changes after a delayed number of pieces

Run:

python experiment_delayed.py

Main output will go to experiment_delayed_results.

Enjoyment percentage across controller/user delays

Mean enjoyment percentage across delay conditions

In this plot:

Axis Meaning
X Controller delay
Y User-change delay
Z Mean enjoyment percentage

Lower delay generally produces higher enjoyment.


Run a visual simulation

Use the visual simulation to watch one selected user play under the selected controller/classifier setup.

python simulation.py --user "Frustrated Freddy"
python simulation.py --user "Average Amy"
python simulation.py --user "Hairy Henry"

The visual simulation opens a Pygame window and waits for ENTER before starting, so the display can be arranged before the run begins.


Notes

  • MAX_MOVES means the maximum number of Tetris pieces the autoplay system attempts to place.
  • A trial can end before MAX_MOVES if the game reaches a terminal state.
  • The main loop performs one classifier prediction, one controller update, and one Tetris piece placement attempt per move.

About

Brain as a System (BaaS), simulates a Neuroadaptive application through systems dynamics. It allows us to research the best controllers and parameters for Neurofeedback loops.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages