-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Roman Andriushchenko
committed
Jun 19, 2024
1 parent
f02b82e
commit 201dcaf
Showing
5 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
P>0.9 [F "goal"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
pomdp | ||
|
||
const int N=8; | ||
const int xMIN = 1; | ||
const int yMIN = 1; | ||
const int xMAX = N; | ||
const int yMAX = N; | ||
|
||
|
||
formula crash = (x1=x2 & y1=y2); | ||
formula goal = (x1=xMAX & y1=yMAX); | ||
formula done = goal | crash; | ||
|
||
observable "x1" = x1; | ||
|
||
formula clk_next = mod(clk+1,2); | ||
module clk | ||
clk : [0..1] init 0; | ||
|
||
[l1] !done & clk=0 -> (clk'=clk_next); | ||
[r1] !done & clk=0 -> (clk'=clk_next); | ||
[d1] !done & clk=0 -> (clk'=clk_next); | ||
[u1] !done & clk=0 -> (clk'=clk_next); | ||
|
||
[l2] !done & clk=1 -> (clk'=clk_next); | ||
[r2] !done & clk=1 -> (clk'=clk_next); | ||
[d2] !done & clk=1 -> (clk'=clk_next); | ||
[u2] !done & clk=1 -> (clk'=clk_next); | ||
endmodule | ||
|
||
label "goal" = goal; | ||
label "__player_1_state__" = clk=0; | ||
|
||
|
||
const double slip = 0.1; | ||
|
||
const int x1_init = 1; | ||
const int y1_init = 1; | ||
|
||
formula x1right = min(x1+1,xMAX); | ||
formula x1left = max(x1-1,xMIN); | ||
formula y1up = min(y1+1,yMAX); | ||
formula y1down = max(y1-1,yMIN); | ||
|
||
module player1 | ||
x1 : [xMIN..xMAX] init x1_init; | ||
y1 : [yMIN..yMAX] init y1_init; | ||
[l1] true -> 1-slip : (x1'=x1left) + slip : (y1'=y1down); | ||
[r1] true -> 1-slip : (x1'=x1right) + slip : (y1'=y1up); | ||
[d1] true -> 1-slip : (y1'=y1down) + slip : (x1'=x1right); | ||
[u1] true -> 1-slip : (y1'=y1up) + slip : (x1'=x1left); | ||
endmodule | ||
|
||
const int x2_init = 4; | ||
const int y2_init = 4; | ||
|
||
formula x2right = min(x2+1,xMAX); | ||
formula x2left = max(x2-1,xMIN); | ||
formula y2up = min(y2+1,yMAX); | ||
formula y2down = max(y2-1,yMIN); | ||
|
||
module player2 | ||
x2 : [xMIN..xMAX] init x2_init; | ||
y2 : [yMIN..yMAX] init y2_init; | ||
[l2] true -> 1-slip : (x2'=x2left) + slip : (y2'=y2down); | ||
[r2] true -> 1-slip : (x2'=x2right) + slip : (y2'=y2up); | ||
[d2] true -> 1-slip : (y2'=y2down) + slip : (x2'=x2right); | ||
[u2] true -> 1-slip : (y2'=y2up) + slip : (x2'=x2left); | ||
endmodule | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import paynt.quotient.quotient | ||
import paynt.quotient.pomdp | ||
|
||
import logging | ||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class PosgQuotient(paynt.quotient.quotient.Quotient): | ||
|
||
# label associated with states of Player 1 | ||
PLAYER_1_STATE_LABEL = "__player_1_state__" | ||
|
||
|
||
def __init__(self, quotient_mdp, specification): | ||
super().__init__(quotient_mdp = quotient_mdp, specification = specification) | ||
|
||
# TODO Antonin | ||
self.coloring = None | ||
self.family = None | ||
self.design_space = None | ||
|
||
pomdp = self.quotient_mdp | ||
print(type(pomdp), dir(pomdp)) | ||
print(dir(pomdp.labeling)) | ||
# print(pomdp.labeling.get_states("__player_1_state__")) | ||
|
||
exit() |