feat(phase-6): implement analytics, kpi calculator, event store, heatmaps, and experiment runner
This commit is contained in:
@@ -138,6 +138,10 @@ class Robot:
|
||||
min_battery_percent: float = 100.0
|
||||
total_energy_consumed_kwh: float = 0.0
|
||||
total_energy_charged_kwh: float = 0.0
|
||||
loaded_distance: float = 0.0
|
||||
empty_distance: float = 0.0
|
||||
handling_time: float = 0.0
|
||||
yield_wait_time: float = 0.0
|
||||
|
||||
@classmethod
|
||||
def from_fleet_dict(cls, fleet_data: Dict[str, Any], type_specs: Dict[str, RobotTypeSpec]) -> Robot:
|
||||
@@ -219,10 +223,21 @@ class Robot:
|
||||
return True
|
||||
return zone_id in self.allowed_zones
|
||||
|
||||
def update_position(self, new_position: Position3D, distance_delta: float, yaw: Optional[float] = None) -> None:
|
||||
"""Update robot spatial coordinates, accumulated travel distance, and heading."""
|
||||
def update_position(
|
||||
self,
|
||||
new_position: Position3D,
|
||||
distance_delta: float,
|
||||
yaw: Optional[float] = None,
|
||||
is_loaded: bool = False,
|
||||
) -> None:
|
||||
"""Update robot spatial coordinates, travel distance (loaded/empty), and heading."""
|
||||
self.position = new_position
|
||||
self.accumulated_distance += max(0.0, distance_delta)
|
||||
dist = max(0.0, distance_delta)
|
||||
self.accumulated_distance += dist
|
||||
if is_loaded:
|
||||
self.loaded_distance += dist
|
||||
else:
|
||||
self.empty_distance += dist
|
||||
if yaw is not None:
|
||||
self.yaw_degrees = yaw % 360.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user