Ajayyy00 commited on
Commit ·
533611a
1
Parent(s): 583fea5
Fix attack_chain KeyError and other validation errors
Browse files
server/play_environment.py
CHANGED
|
@@ -485,7 +485,7 @@ class CyberSOCEnvironment(Environment):
|
|
| 485 |
if not self._state.is_done:
|
| 486 |
impact_rate = self._task_def.get("impact_per_step", 0.02)
|
| 487 |
active_ratio = len(self._state.active_threats) / max(
|
| 488 |
-
1, len(self._task_def
|
| 489 |
)
|
| 490 |
self._state.business_impact = min(
|
| 491 |
1.0, self._state.business_impact + impact_rate * active_ratio
|
|
|
|
| 485 |
if not self._state.is_done:
|
| 486 |
impact_rate = self._task_def.get("impact_per_step", 0.02)
|
| 487 |
active_ratio = len(self._state.active_threats) / max(
|
| 488 |
+
1, len(self._task_def.get("attack_chain", []))
|
| 489 |
)
|
| 490 |
self._state.business_impact = min(
|
| 491 |
1.0, self._state.business_impact + impact_rate * active_ratio
|