Increase energy parameters and initial cell count for simulation dynamics
This commit is contained in:
parent
69296cf4b7
commit
de45db4393
@ -79,7 +79,7 @@ class InteractiveConfig:
|
|||||||
grid_width=GRID_WIDTH,
|
grid_width=GRID_WIDTH,
|
||||||
grid_height=GRID_HEIGHT,
|
grid_height=GRID_HEIGHT,
|
||||||
cell_size=CELL_SIZE,
|
cell_size=CELL_SIZE,
|
||||||
initial_cells=50,
|
initial_cells=350,
|
||||||
initial_food=FOOD_OBJECTS_COUNT,
|
initial_food=FOOD_OBJECTS_COUNT,
|
||||||
food_spawning=FOOD_SPAWNING,
|
food_spawning=FOOD_SPAWNING,
|
||||||
random_seed=RANDOM_SEED,
|
random_seed=RANDOM_SEED,
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class SimulationEngine:
|
|||||||
grid_width=GRID_WIDTH,
|
grid_width=GRID_WIDTH,
|
||||||
grid_height=GRID_HEIGHT,
|
grid_height=GRID_HEIGHT,
|
||||||
cell_size=CELL_SIZE,
|
cell_size=CELL_SIZE,
|
||||||
initial_cells=50,
|
initial_cells=350,
|
||||||
initial_food=FOOD_OBJECTS_COUNT,
|
initial_food=FOOD_OBJECTS_COUNT,
|
||||||
food_spawning=FOOD_SPAWNING,
|
food_spawning=FOOD_SPAWNING,
|
||||||
random_seed=RANDOM_SEED,
|
random_seed=RANDOM_SEED,
|
||||||
|
|||||||
@ -93,7 +93,7 @@ class FoodObject(BaseEntity):
|
|||||||
self.max_visual_width: int = 8
|
self.max_visual_width: int = 8
|
||||||
self.decay: int = 0
|
self.decay: int = 0
|
||||||
self.decay_rate: int = 1
|
self.decay_rate: int = 1
|
||||||
self.max_decay = 200
|
self.max_decay = 400
|
||||||
self.interaction_radius: int = 50
|
self.interaction_radius: int = 50
|
||||||
self.neighbors: int = 0
|
self.neighbors: int = 0
|
||||||
self.flags: dict[str, bool] = {
|
self.flags: dict[str, bool] = {
|
||||||
@ -300,11 +300,11 @@ class DefaultCell(BaseEntity):
|
|||||||
distance_to_food = get_distance_between_objects(self, food_object)
|
distance_to_food = get_distance_between_objects(self, food_object)
|
||||||
|
|
||||||
if distance_to_food < self.max_visual_width and food_objects:
|
if distance_to_food < self.max_visual_width and food_objects:
|
||||||
self.energy += 130
|
self.energy += 140
|
||||||
food_object.flag_for_death()
|
food_object.flag_for_death()
|
||||||
return self
|
return self
|
||||||
|
|
||||||
if self.energy >= 1600:
|
if self.energy >= 1700:
|
||||||
# too much energy, split
|
# too much energy, split
|
||||||
duplicate_x, duplicate_y = self.position.get_position()
|
duplicate_x, duplicate_y = self.position.get_position()
|
||||||
duplicate_x += random.randint(-self.max_visual_width, self.max_visual_width)
|
duplicate_x += random.randint(-self.max_visual_width, self.max_visual_width)
|
||||||
@ -350,7 +350,7 @@ class DefaultCell(BaseEntity):
|
|||||||
|
|
||||||
movement_cost = abs(output_data["angular_acceleration"]) + abs(output_data["linear_acceleration"])
|
movement_cost = abs(output_data["angular_acceleration"]) + abs(output_data["linear_acceleration"])
|
||||||
|
|
||||||
self.energy -= (self.behavioral_model.neural_network.network_cost * 0.1) + 1.2 + (0.15 * movement_cost)
|
self.energy -= (self.behavioral_model.neural_network.network_cost * 0.08) + 1.5 + (0.25 * movement_cost)
|
||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user