NAVADMC / ADSM

A simulation of disease spread in livestock populations. Includes detection and containment simulation.
Other
9 stars 5 forks source link

Read Population directly from DB #130

Closed josiahseaman closed 10 years ago

josiahseaman commented 10 years ago

And drop the command line argument requirement. This should bypass #39.

josiahseaman commented 10 years ago

You'll be reading scenariocreator_Unit table which is declared here:

class Unit(models.Model):
    _population = models.ForeignKey(Population, default=lambda: Population.objects.get_or_create(id=1)[0], )  # If you're having an OperationalError creating a migration, remove the default on ForeignKeys duration south --auto process.
    production_type = models.ForeignKey('ProductionType',
        help_text='The production type that these outputs apply to.', )
    latitude = LatitudeField(
        help_text='The latitude used to georeference this unit.', )
    longitude = LongitudeField(
        help_text='The longitude used to georeference this unit.', )
    initial_state_choices = (('S', 'Susceptible'),
               ('L', 'Latent'),
               ('B', 'Infectious Subclinical'),
               ('C', 'Infectious Clinical'),
               ('N', 'Naturally Immune'),
               ('V', 'Vaccine Immune'),
               ('D', 'Destroyed'))
    initial_state = models.CharField(max_length=255, default='S',
                                     help_text='Code indicating the actual disease state of the unit at the beginning of the simulation.',
                                     choices=initial_state_choices)
    days_in_initial_state = models.IntegerField(blank=True, null=True,
        help_text='The number of days that the unit will remain in its initial state unless preempted by other events.', )
    days_left_in_initial_state = models.IntegerField(blank=True, null=True,
        help_text='', )
    initial_size = models.PositiveIntegerField(
        help_text='The number of animals in the unit.', )
    _final_state_code = models.CharField(max_length=255, blank=True,
        help_text='Code indicating the actual disease state of the unit at the end of the simulation.', )
    _final_control_state_code = models.CharField(max_length=255, blank=True,
        help_text='', )
    _final_detection_state_code = models.CharField(max_length=255, blank=True,
        help_text='', )
    _cum_infected = models.PositiveIntegerField(blank=True, null=True,
        help_text='The total number of iterations in which this unit became infected.', )
    _cum_detected = models.PositiveIntegerField(blank=True, null=True,
        help_text='The total number of iterations in which this unit was detected.', )
    _cum_destroyed = models.PositiveIntegerField(blank=True, null=True,
        help_text='The total number of iterations in which this unit was destroyed.', )
    _cum_vaccinated = models.PositiveIntegerField(blank=True, null=True,
        help_text='The total number of iterations in which this unit was vaccinated.', )
    user_defined_1 = models.TextField(blank=True)
    user_defined_2 = models.TextField(blank=True)
    user_defined_3 = models.TextField(blank=True)
    user_defined_4 = models.TextField(blank=True)