Spaces:
Sleeping
Sleeping
KrisKeshav commited on
small changes
Browse files- src/attacks.py +2 -4
src/attacks.py
CHANGED
|
@@ -68,11 +68,9 @@ class AttackGenerator:
|
|
| 68 |
def get_signal(self, current_step: int, sim_time: float) -> float:
|
| 69 |
"""
|
| 70 |
Compute the attack signal value at the given step.
|
| 71 |
-
|
| 72 |
Args:
|
| 73 |
current_step: Current environment step (0-indexed).
|
| 74 |
sim_time: Current simulation time in seconds.
|
| 75 |
-
|
| 76 |
Returns:
|
| 77 |
Attack signal value (pu). Returns 0.0 if attack not yet started.
|
| 78 |
"""
|
|
@@ -111,7 +109,7 @@ class AttackGenerator:
|
|
| 111 |
return 0.0
|
| 112 |
|
| 113 |
def is_active(self, current_step: int) -> bool:
|
| 114 |
-
"""
|
| 115 |
if current_step < self.attack_start_step:
|
| 116 |
return False
|
| 117 |
|
|
@@ -125,7 +123,7 @@ class AttackGenerator:
|
|
| 125 |
|
| 126 |
|
| 127 |
def get_attack_type_id(attack_type_str: str) -> int:
|
| 128 |
-
"""
|
| 129 |
mapping = {
|
| 130 |
"none": 0,
|
| 131 |
"sinusoidal": 1,
|
|
|
|
| 68 |
def get_signal(self, current_step: int, sim_time: float) -> float:
|
| 69 |
"""
|
| 70 |
Compute the attack signal value at the given step.
|
|
|
|
| 71 |
Args:
|
| 72 |
current_step: Current environment step (0-indexed).
|
| 73 |
sim_time: Current simulation time in seconds.
|
|
|
|
| 74 |
Returns:
|
| 75 |
Attack signal value (pu). Returns 0.0 if attack not yet started.
|
| 76 |
"""
|
|
|
|
| 109 |
return 0.0
|
| 110 |
|
| 111 |
def is_active(self, current_step: int) -> bool:
|
| 112 |
+
"""Checking if the attack is currently active at this step."""
|
| 113 |
if current_step < self.attack_start_step:
|
| 114 |
return False
|
| 115 |
|
|
|
|
| 123 |
|
| 124 |
|
| 125 |
def get_attack_type_id(attack_type_str: str) -> int:
|
| 126 |
+
"""Mapping attack type string to integer ID."""
|
| 127 |
mapping = {
|
| 128 |
"none": 0,
|
| 129 |
"sinusoidal": 1,
|