@@ 85-87 (lines=3) @@ | ||
82 | ||
83 | public function start($verbose = true) |
|
84 | { |
|
85 | if ($this->organisms == null || $this->species == null || $this->iterations == null) { |
|
86 | throw new \Exception('Not ready yet'); |
|
87 | } |
|
88 | ||
89 | $this->life->start($verbose); |
|
90 | ||
@@ 127-129 (lines=3) @@ | ||
124 | ||
125 | private function createWorld() |
|
126 | { |
|
127 | if ($this->size == null || $this->species == null | $this->iterations == null) { |
|
128 | throw new \Exception('Not ready yet'); |
|
129 | } |
|
130 | ||
131 | if ($this->size < 0 || $this->species < 0 || $this->iterations < 0) { |
|
132 | throw new \InvalidArgumentException("World arguments should be positive."); |
|
@@ 140-142 (lines=3) @@ | ||
137 | ||
138 | private function createOrganisms() |
|
139 | { |
|
140 | if ($this->size == null || $this->species == null) { |
|
141 | throw new \Exception('Not ready yet'); |
|
142 | } |
|
143 | ||
144 | if ($this->size < 0 || $this->species < 0) { |
|
145 | throw new \InvalidArgumentException("Organisms arguments should be positive."); |