Skip to content

Installation

gnitr edited this page Feb 11, 2018 · 12 revisions

Requirements

  • Python 3.6+

Set up a development environment

  • clone the repo
  • checkout the latest stable tag (e.g. 0.4)
  • create a python virtual environment (use conda or virtualenv)
  • populate it with pip install -r requirements.txt
  • create a file called local.py under unscripted/settings with something like this:

from .base import *

DEBUG = True

SECRET_KEY = 'yoursecrekey'

ALLOWED_HOSTS = ['*']

DB_THINGS['PORT'] = 27017

UNSCRIPTED_ENGINE_BACKEND = 'pymemdb'

UNSCRIPTED_REMOTE_API = 'ws://127.0.0.1:8000/api/1/'

UNSCRIPTED_REQUEST_BACKEND = 'WSSession'

UNSCRIPTED_REQUEST_ASYNC = 1

  • python manage.py migrate

Create a World

  • run the web server: python manage.py ucore runserver
  • let it run, now open a different terminal session session and:
  • (re)create a new virtual world: python manage.py ucore crunch; python manage.py ucore new
  • populate the world with bots: python manage.py utest any repop_well

Run a bot

  • simulate 100 cycles: python manage.py utest any simulate --cycle 100

Visualise the World

  • you can also visualise the world while the server is running by pointing your browser to http://localhost:8000/worlds/WORLDID . Where WORLDID is a unique identifier for the world that can be obtained by running python manage.py ucore info

Access the API