@@ 115-117 (lines=3) @@ | ||
112 | */ |
|
113 | public function start($verbose = true) |
|
114 | { |
|
115 | if ($this->organisms == null || $this->species == null || $this->iterations == null) { |
|
116 | throw new \Exception('Not ready yet'); |
|
117 | } |
|
118 | ||
119 | $this->life->start($verbose); |
|
120 | ||
@@ 153-155 (lines=3) @@ | ||
150 | */ |
|
151 | private function createWorld() |
|
152 | { |
|
153 | if ($this->size == null || $this->species == null | $this->iterations == null) { |
|
154 | throw new \Exception('Not ready yet'); |
|
155 | } |
|
156 | ||
157 | if ($this->size < 0 || $this->species < 0 || $this->iterations < 0) { |
|
158 | throw new \InvalidArgumentException("World arguments should be positive."); |
|
@@ 171-173 (lines=3) @@ | ||
168 | */ |
|
169 | private function createOrganisms() |
|
170 | { |
|
171 | if ($this->size == null || $this->species == null) { |
|
172 | throw new \Exception('Not ready yet'); |
|
173 | } |
|
174 | ||
175 | if ($this->size < 0 || $this->species < 0) { |
|
176 | throw new \InvalidArgumentException("Organisms arguments should be positive."); |