Skip to content
Snippets Groups Projects
Commit 9a6e1404 authored by Hendrik Schwanekamp's avatar Hendrik Schwanekamp
Browse files

add simulator class that has a list of trees

parent e81e3cde
No related branches found
No related tags found
No related merge requests found
import numpy as np
import Tree
import TreeSpecies as ts
class Simulator:
trees = 0 # current status of all trees in the simulation
stepsize = 1 # the internal integration stepsize in years
def __init__(self, numTrees):
self.trees = np.empty(numTrees, Tree.Tree)
for i in range(numTrees):
species = ts.species[np.random.randint(0, 5)]
pos = np.random.random(2)
self.trees[i] = Tree.Tree(pos, species)
def advance(self, years):
"""Advances the simulation by years amount of years.
Returns a copy of the current list of trees."""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment