Skip to content
Snippets Groups Projects
Commit 1a15c866 authored by aastorg2's avatar aastorg2
Browse files

last changes on teacher_base

parent 0b6342f2
No related branches found
No related tags found
No related merge requests found
import abc import abc
import itertools import itertools
from typing import Dict, Hashable, List, Literal, Optional, Sequence, Tuple #from typing import Dict, Hashable, List, Literal, Optional, Sequence, Tuple
from typing import Dict, Hashable, List, Optional, Sequence, Tuple
import gurobipy as gp import gurobipy as gp
import numpy as np import numpy as np
...@@ -46,7 +47,7 @@ class DRealTeacherBase(TeacherBase): ...@@ -46,7 +47,7 @@ class DRealTeacherBase(TeacherBase):
] ]
def __init__(self, name: str, def __init__(self, name: str,
state_dim: int, perc_dim: int, ctrl_dim: int, norm_ord: Literal[1, 2, "inf"], state_dim: int, perc_dim: int, ctrl_dim: int, norm_ord,
delta: float = 0.001) -> None: delta: float = 0.001) -> None:
self._norm_ord = norm_ord self._norm_ord = norm_ord
self._delta = delta self._delta = delta
...@@ -140,7 +141,7 @@ class GurobiTeacherBase(TeacherBase): ...@@ -140,7 +141,7 @@ class GurobiTeacherBase(TeacherBase):
TRIGVAR = {"vtype": gp.GRB.CONTINUOUS, "lb": -1.0, "ub": 1.0} TRIGVAR = {"vtype": gp.GRB.CONTINUOUS, "lb": -1.0, "ub": 1.0}
def __init__(self, name: str, def __init__(self, name: str,
state_dim: int, perc_dim: int, ctrl_dim: int, norm_ord: Literal[1, 2, "inf"] = 2) -> None: state_dim: int, perc_dim: int, ctrl_dim: int, norm_ord = 2) -> None:
super().__init__() super().__init__()
self._gp_model = gp.Model(name) self._gp_model = gp.Model(name)
...@@ -225,7 +226,7 @@ class GurobiTeacherBase(TeacherBase): ...@@ -225,7 +226,7 @@ class GurobiTeacherBase(TeacherBase):
class SymPyTeacherBase(TeacherBase): class SymPyTeacherBase(TeacherBase):
def __init__(self, name: str, def __init__(self, name: str,
state_dim: int, perc_dim: int, ctrl_dim: int, norm_ord: Literal[1, 2, "inf"]) -> None: state_dim: int, perc_dim: int, ctrl_dim: int, norm_ord) -> None:
self._norm_ord = norm_ord self._norm_ord = norm_ord
# Old state variables # Old state variables
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment