Skip to content

simplworld/simpl-blackjack-model

Repository files navigation

simpl-blackjack-model - example single-player simulation model service.

Python Setup (assumes Python >= 3.6 and simpl-games-api server running)

$ git clone git@github.com:simplworld/simpl-blackjack-model.git
$ cd simpl-blackjack-model
$ mkvirtualenv simpl-blackjack-model
$ add2virtualenv .

$ pip install -r requirements.txt

Run model service

$ export DJANGO_SETTINGS_MODULE=simpl_blackjack_model.settings
$ ./manage.py run_modelservice

If you need some serious debugging help, the model_service includes the ability to do

$ ./manage.py run_modelservice --loglevel=debug

Which will turn on verbose debugging of the Autobahn/Crossbar daemon to help debug interactions between the browser and model service backend.

Run unit tests

$ pytest

Development commands:

1 - To setup up database for simpl-blackjack development use:

  1. Creates the simpl-blackjack game with one phase (Play) and one role (Blackjackulator).
  2. Adds a 'default' run..
  3. Adds 1 leader ('leader@blackjack.edu'/'leader') to the run.
  4. Adds 2 players to the run ('s#@blackjack.edu'/'s#' where # is between 1..2. Each player has a private scenario and period 1.
  5. The run is set to 'Play' phase

execute:

$ ./manage.py create_default_env

To make it easier to recreate the default run you can pass the --reset option to delete the default run and recreate it from scratch like this:

$ ./manage.py create_default_env --reset

Reset Game

To reset the run and empty all of the user scenarios run this command:

$ ./manage.py reset_game

You can also reset a single user with either:

$ ./manage.py reset_user --pk=14

or

$ ./manage.py reset_user --email="bob@bob.com"

Copyright © 2018 The Wharton School,  The University of Pennsylvania 

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

About

Model for example Blackjack game using Simpl framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published