from otree.api import ( models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer, Currency as c, currency_range ) from django.db import models as django_models author = 'Your name here' doc = """ Your app description """ class Constants(BaseConstants): name_in_url = 'testing' players_per_group = None num_rounds = 1 class Subsession(BaseSubsession): pass class Group(BaseGroup): pass class Player(BasePlayer): # name = models.CharField() # age = models.IntegerField() multiplier = models.FloatField( choices=[17.82, 24.56, 45.82, 74.91] ) startingPoint = models.IntegerField( choices=[1, 2] ) numberOfGameSteps = models.IntegerField( choices=[12, 24] ) # numberOfChoices = models.IntegerField( # # choices=[6, 7, 8, 9, 10, 11, 12] # choices=[6] # ) # pointToSubtract = models.IntegerField( # choices=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # ) waitingWindow = models.BooleanField() class AlienGameLandscape(django_models.Model): landscape = models.CharField() class FitnessData(django_models.Model): # bitstringID = models.IntegerField(primary_key=True, null=False) bitstringID = models.IntegerField(null=False) bitstring = models.CharField() fitness = models.FloatField() alien_game_landscape = django_models.ForeignKey(AlienGameLandscape) # class FitnessDataChoices(django_models.Model): # query = models.FitnessData.objects.values("semanticScenarioDescription").distinct() # scenario = query.v # class FitnessData(django_models.Model): # # bitstringID = models.IntegerField(primary_key=True, null=False) # an auto ID will be added to each entry # bitstring = models.CharField() # fitness = models.FloatField() # semanticTableDescription = models.CharField() class GameStep(django_models.Model): player = django_models.ForeignKey(Player) subsession = django_models.ForeignKey(Subsession) fitnessData = django_models.ForeignKey(FitnessData) # CASCADE this too after rewriting DB uploading gameStepCount = models.IntegerField() timestamp = models.IntegerField()