diff --git a/core/simulation_engine.py b/core/simulation_engine.py index 29db164..c39147e 100644 --- a/core/simulation_engine.py +++ b/core/simulation_engine.py @@ -95,6 +95,14 @@ class SimulationEngine: return world + def _count_cells(self): + count = 0 + for entity in self.world.get_objects(): + if isinstance(entity, DefaultCell): + count += 1 + return count + + def run(self): while self.running: self._handle_frame() diff --git a/world/objects.py b/world/objects.py index 2ab9253..5dd4edd 100644 --- a/world/objects.py +++ b/world/objects.py @@ -386,7 +386,7 @@ class DefaultCell(BaseEntity): movement_cost = abs(output_data["angular_acceleration"]) + abs(output_data["linear_acceleration"]) - self.energy -= (self.behavioral_model.neural_network.network_cost * 0.01) + 1 + (0.5 * movement_cost) + self.energy -= (self.behavioral_model.neural_network.network_cost * 0.03) + 1 + (0.3 * movement_cost) return self