|
1 | 1 | from ..ca_environment.active_ca import ActiveCAEnv |
| 2 | +from ..ca_environment.acive_ca_proba import ProbaActiveCAEnv |
2 | 3 | from .findscope_core import FindScopeBase |
3 | 4 | from ..utils import get_kappa, get_con_subset |
4 | | - |
| 5 | +from ..find_scope.findscope_obj import split_proba, split_half |
5 | 6 |
|
6 | 7 | class FindScope2(FindScopeBase): |
7 | 8 | """ |
8 | 9 | This is the version of the FindScope function that was presented in |
9 | 10 | Bessiere, Christian, et al., "Learning constraints through partial queries", AIJ 2023 |
10 | 11 | """ |
11 | 12 |
|
12 | | - def __init__(self, ca_env: ActiveCAEnv = None, time_limit=0.2): |
| 13 | + def __init__(self, ca_env: ActiveCAEnv = None, split_func=None, time_limit=0.2): |
13 | 14 | """ |
14 | 15 | Initialize the FindScope2 class. |
15 | 16 |
|
16 | 17 | :param ca_env: The constraint acquisition environment. |
17 | 18 | :param time_limit: The time limit for findscope query generation. |
| 19 | + :param split_func: The function used to split the variables in findscope. |
18 | 20 | """ |
19 | | - super().__init__(ca_env, time_limit) |
| 21 | + |
| 22 | + if split_func is None: |
| 23 | + split_func = split_proba if isinstance(ca_env, ProbaActiveCAEnv) else split_half |
| 24 | + |
| 25 | + super().__init__(ca_env, time_limit, split_func=split_func) |
20 | 26 | self._kappaB = [] |
21 | 27 |
|
22 | 28 | def run(self, Y, kappa=None): |
@@ -72,7 +78,7 @@ def _find_scope(self, R, Y): |
72 | 78 |
|
73 | 79 | # Create Y1, Y2 ------------------------- |
74 | 80 | proba = self.ca.bias_proba if hasattr(self.ca, 'bias_proba') else [] |
75 | | - Y1, Y2 = self.split_func(Y=Y, R=R, kappaB=kappaBRY, proba=proba) |
| 81 | + Y1, Y2 = self.split_func(Y=Y, R=R, kappaB=kappaBRY, P_c=proba) |
76 | 82 |
|
77 | 83 | S1 = set() |
78 | 84 | S2 = set() |
|
0 commit comments