Adjust energy cost calculation in movement and increase initial cell count in simulation
This commit is contained in:
		
							parent
							
								
									8bb5c3edfc
								
							
						
					
					
						commit
						31c3244b5a
					
				| @ -85,7 +85,7 @@ class SimulationEngine: | |||||||
|                 y = random.randint(-half_height // 2, half_height // 2) |                 y = random.randint(-half_height // 2, half_height // 2) | ||||||
|                 world.add_object(FoodObject(Position(x=x, y=y))) |                 world.add_object(FoodObject(Position(x=x, y=y))) | ||||||
| 
 | 
 | ||||||
|         for _ in range(300): |         for _ in range(350): | ||||||
|             new_cell = DefaultCell( |             new_cell = DefaultCell( | ||||||
|                 Position(x=random.randint(-half_width // 2, half_width // 2), y=random.randint(-half_height // 2, half_height // 2)), |                 Position(x=random.randint(-half_width // 2, half_width // 2), y=random.randint(-half_height // 2, half_height // 2)), | ||||||
|                 Rotation(angle=0) |                 Rotation(angle=0) | ||||||
|  | |||||||
| @ -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.15) + 1 + (0.3 * movement_cost) |         self.energy -= (self.behavioral_model.neural_network.network_cost * 0.15) + 1 + (0.2 * movement_cost) | ||||||
| 
 | 
 | ||||||
|         return self |         return self | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user