Repository: pyrddlgym-project/pyRDDLGym (language: python)

Issue:
Merge Main to Jack



Discussion / hints:

Fix patch:
diff --git a/Competition/Drone/domain.rddl b/Competition/Drone/domain.rddl
deleted file mode 100644
index 4259a649..00000000
--- a/Competition/Drone/domain.rddl
+++ /dev/null
@@ -1,243 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-//
-// Drone RDDL domain
-//
-///////////////////////////////////////////////////////////////////////////////
-
-domain simple_aircraft_with_roll_test{
-
-types {
-    aircraft : object;
-
-};
-
-pvariables {
-
-    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
-
-    // Bounds on the position of the aircraft
-    MIN_X : { non-fluent, real, default = -50000.0};
-    MAX_X : { non-fluent, real, default = 50000.0};
-    MIN_Y : { non-fluent, real, default = -50000.0};
-    MAX_Y : { non-fluent, real, default = 50000.0};
-    MIN_Z : { non-fluent, real, default = -50000.0};
-    MAX_Z : { non-fluent, real, default = 50000.0};
-
-
-    MIN_G_LOAD(aircraft) : { non-fluent, real, default = 1.0};
-    MAX_G_LOAD(aircraft) : { non-fluent, real, default = 8.0};
-    MAX_ROLL(aircraft) : { non-fluent, real, default = 1.57};
-    MIN_ROLL(aircraft) : { non-fluent, real, default = -1.57};
-    MAX_PITCH(aircraft) : { non-fluent, real, default = 1.22};
-    MIN_PITCH(aircraft) : { non-fluent, real, default = -1.22};
-
-    GRAVITY : { non-fluent, real, default = 9.8};
-
-
-    // Speed bounds
-    MIN_SPEED(aircraft) : { non-fluent, real, default = -1.75};
-    MAX_SPEED(aircraft) : { non-fluent, real, default = 1.75};
-    
-    // Coordinates
-    pos_x(aircraft) : { state-fluent, real, default = 0.0 };
-    pos_y(aircraft) : { state-fluent, real, default = 0.0 }; 
-    pos_z(aircraft) : { state-fluent, real, default = 0.0 };
-
-    //Drone state
-    g_load(aircraft) : { state-fluent, real, default = 0.0 };
-
-    // velocity
-    vel(aircraft) : { state-fluent, real, default = 0.0 };
-
-    // Rates at which control variables change (per second)
-    // radians / sec
-    yaw_rate(aircraft) : { state-fluent, real, default = 0.0 };
-    pitch_rate(aircraft) : { state-fluent, real, default = 0.012 };
-    roll_rate(aircraft) : { state-fluent, real, default = 0.174};
-
-    // Control variables
-    psi(aircraft) : { state-fluent, real, default = 0.0 };    // yaw
-    theta(aircraft) : { state-fluent, real, default = 0.0 };  // pitch
-    phi(aircraft) : { state-fluent, real, default = 0.0 };    // roll
-    phi_c(aircraft) : { state-fluent, real, default = 0.0 };  // target roll
-
-
-    // meters / sec
-    speed_rate(aircraft) : { state-fluent, real, default = 0.0 };
-
-    // auxiliary variables to track control of
-    speed_control_accelerating(aircraft) : { state-fluent, bool, default = false };
-    speed_control_decelerating(aircraft) : { state-fluent, bool, default = false };
-    speed_control_cruising(aircraft) : { state-fluent, bool, default = true };
-    
-    pitch_control_upwards(aircraft) : { state-fluent, bool, default = false };
-    pitch_control_downwards(aircraft) : { state-fluent, bool, default = false };
-    pitch_control_level(aircraft) : { state-fluent, bool, default = true };
-
-    // goal position
-    goal_x(aircraft) : {state-fluent, real, default = 100.0};
-    goal_y(aircraft) : {state-fluent, real, default = 100.0};
-    goal_z(aircraft) : {state-fluent, real, default = 100.0};
-
-    // actions
-    accelerate(aircraft) : {action-fluent, bool, default = false};
-    decelerate(aircraft) : {action-fluent, bool, default = false};
-    cruise(aircraft) : {action-fluent, bool, default = false};
-    pull_lever(aircraft) : {action-fluent, bool, default = false};
-    push_lever(aircraft) : {action-fluent, bool, default = false};
-    neutral_lever(aircraft) : {action-fluent, bool, default = false};
-    increase_g_load(aircraft) : {action-fluent, bool, default = false};
-    decrease_g_load(aircraft) : {action-fluent, bool, default = false};
-    reset_g_load(aircraft) : {action-fluent, bool, default = false};
-
-
-};
-
-cpfs {
-
-    // position changes for each time step
-    pos_x'(?a) = pos_x(?a) + vel(?a) * cos[psi(?a)];
-    pos_y'(?a) = pos_y(?a) + vel(?a) * sin[psi(?a)];
-    pos_z'(?a) = pos_z(?a) + vel(?a) + sin[theta(?a)];
-
-    // position of the goal
-    goal_x'(?a) = goal_x(?a);
-    goal_y'(?a) = goal_y(?a);
-    goal_z'(?a) = goal_z(?a);
- 
-    // velocity changes for each time step
-    vel'(?a) = 
-        if (speed_control_accelerating(?a) ^ (vel(?a) < MAX_SPEED(?a)) )
-            then vel(?a) + speed_rate(?a)
-        else if (speed_control_decelerating(?a) ^ (vel(?a) < MAX_SPEED(?a)) )
-            then vel(?a) - speed_rate(?a)
-        else vel(?a);
-
-    // yaw changes when pitch upwards
-    psi'(?a) = 
-        if (pitch_control_upwards(?a))
-            then psi(?a) + yaw_rate(?a)
-        else psi(?a);
-    
-    // roll changes
-    phi'(?a) = 
-        if ( (phi_c(?a) > phi(?a)) ^ (phi(?a) < MAX_ROLL(?a)) )
-            then phi(?a) + roll_rate(?a)
-        else if ( (phi_c(?a) < phi(?a)) ^ (phi(?a) > MIN_ROLL(?a)))
-            then phi(?a) - roll_rate(?a)
-        else phi(?a);
-
-    // pitch change when move upwards and downwards
-    theta'(?a) = 
-        if (pitch_control_upwards(?a) ^ (theta(?a) < MAX_PITCH(?a)) )
-            then theta(?a) + pitch_rate(?a)
-        else if (pitch_control_downwards(?a) ^ (theta(?a) > MIN_PITCH(?a)) )
-            then theta(?a) - pitch_rate(?a)
-        else theta(?a);
-
-    // target control changes
-    phi_c'(?a) = 
-        if ( (g_load(?a) <= MAX_G_LOAD(?a)) ^ (phi_c(?a) < MAX_ROLL(?a)) ^ CONTROLLABLE(?a) ^ increase_g_load(?a))
-            then acos[1.0 / (g_load(?a) + 0.1)]
-        else if ( (g_load(?a) >= MIN_G_LOAD(?a)) ^ CONTROLLABLE(?a) ^ decrease_g_load(?a))
-            then acos[1.0 / (g_load(?a) + 0.1)]
-        else if (CONTROLLABLE(?a) ^ reset_g_load(?a))
-            then 0.0
-        else phi_c(?a);
-
-    // g_load change
-    g_load'(?a) = 
-        if ( (g_load(?a) <= MAX_G_LOAD(?a)) ^ CONTROLLABLE(?a) ^ increase_g_load(?a))
-            then g_load(?a) + 0.1
-        else if ( (g_load(?a) >= MIN_G_LOAD(?a)) ^ CONTROLLABLE(?a) ^ decrease_g_load(?a))
-            then g_load(?a) - 0.1
-        else if (CONTROLLABLE(?a) ^ reset_g_load(?a))
-            then 1.0
-        else
-            g_load(?a);
-
-    // not sure if this is constant
-    speed_rate'(?a) = speed_rate(?a);
-    pitch_rate'(?a) = pitch_rate(?a);
-    roll_rate'(?a) = roll_rate(?a);
-
-
-    // yaw rate 
-    yaw_rate'(?a) = 
-        if (pitch_control_upwards(?a))
-            then yaw_rate(?a) + (tan[phi(?a)] / vel(?a)) * GRAVITY
-        else yaw_rate(?a);
-    
-
-    // Instantaneous actions
-    speed_control_accelerating'(?a) = 
-        if (CONTROLLABLE(?a) ^ accelerate(?a) ^ (vel(?a) < MAX_SPEED(?a)) )
-            then true
-        else if (CONTROLLABLE(?a) ^ cruise(?a))
-            then false
-        else speed_control_accelerating(?a);
-
-    speed_control_decelerating'(?a) = 
-        if (CONTROLLABLE(?a) ^ decelerate(?a) ^ (vel(?a) > MIN_SPEED(?a)) )
-            then true
-        else if (CONTROLLABLE(?a) ^ cruise(?a))
-            then false
-        else speed_control_decelerating(?a);
-
-    speed_control_cruising'(?a) =
-        if (CONTROLLABLE(?a) ^ cruise(?a))
-            then true
-        else if (CONTROLLABLE(?a) ^ (accelerate(?a) | decelerate(?a)))
-            then false
-        else speed_control_cruising(?a);
-
-    pitch_control_upwards'(?a) = 
-        if (CONTROLLABLE(?a) ^ pull_lever(?a))
-            then true
-        else if (CONTROLLABLE(?a) ^ neutral_lever(?a))
-            then false
-        else pitch_control_upwards(?a);
-
-    pitch_control_downwards'(?a) = 
-        if (CONTROLLABLE(?a) ^ push_lever(?a))
-            then true
-        else if (CONTROLLABLE(?a) ^ neutral_lever(?a))
-            then false
-        else pitch_control_downwards(?a);
-
-    pitch_control_level'(?a) =
-        if (CONTROLLABLE(?a) ^ neutral_lever(?a))
-            then true
-        else if (CONTROLLABLE(?a) ^ (pull_lever(?a) | push_lever(?a)))
-            then false
-        else pitch_control_level(?a);
-
-};
-
-state-invariants {
-    // boundries of the aircarft locations
-    forall_{?a : aircraft}[ pos_x(?a) <= MAX_X ^ pos_x(?a) >= MIN_X ^
-                            pos_y(?a) <= MAX_Y ^ pos_y(?a) >= MIN_Y ^
-                            pos_z(?a) <= MAX_Z ^ pos_x(?a) >= MIN_Z ];
-};
-
-reward = sum_{?a : aircraft} [sqrt[pow[(pos_x(?a) - goal_x(?a)),2] + 
-                                   pow[(pos_y(?a) - goal_y(?a)),2] +
-                                   pow[(pos_z(?a) - goal_z(?a)),2]] ];
-
-action-preconditions {
-    // Max of one action per aircraft.
-    forall_{?a : aircraft} [(accelerate(?a) + decelerate(?a) + cruise(?a) +
-                             pull_lever(?a) + push_lever(?a) + neutral_lever(?a) + 
-                             increase_g_load(?a) + decrease_g_load(?a) + reset_g_load(?a)) <= 1];
-
-    
-    // Need to cruise before accelrate or decelerate
-    forall_{?a : aircraft} [accelerate(?a) => speed_control_cruising(?a)];
-    forall_{?a : aircraft} [decelerate(?a) => speed_control_cruising(?a)];
-    forall_{?a : aircraft} [pull_lever(?a) => pitch_control_level(?a)];
-    forall_{?a : aircraft} [push_lever(?a) => pitch_control_level(?a)];
-
-};
-
-}
\ No newline at end of file
diff --git a/Competition/Drone/insta0.rddl b/Competition/Drone/insta0.rddl
deleted file mode 100644
index 257ddf17..00000000
--- a/Competition/Drone/insta0.rddl
+++ /dev/null
@@ -1,73 +0,0 @@
-non-fluents nf_drone_mdp__1 {
-	domain = simple_aircraft_with_roll_test;
-
-	objects {
-		aircraft : {a1};
-	};
-
-	non-fluents {
-        // Bounds on the position of the aircraft
-        MIN_X = -50000.0;
-        MAX_X = 500000.0;
-        MIN_Y = -500000.0;
-        MAX_Y = 500000.0;
-        MIN_Z = -50000.0;
-        MAX_Z = 50000.0;
-        MIN_G_LOAD = 1.0;
-        MAX_G_LOAD = 8.0;
-        MAX_ROLL = 1.57;
-        MIN_ROLL = -1.58;
-        MAX_PITCH = 1.22;
-        MIN_PITCH = -1.22;
-
-        GRAVITY = 9.8;
-
-        // Speed bounds
-        MIN_SPEED(a1) = -1.75;
-        MAX_SPEED(a1) = 1.75;
-
-        CONTROLLABLE(a1);
-	};
-}
-
-instance drone_mdp__1 {
-	domain = simple_aircraft_with_roll_test;
-	non-fluents = nf_drone_mdp__1;
-	init-state {
-	pos_x(a1) = 0.0;
-        pos_y(a1) = 0.0;
-        pos_z(a1) = 0.0;
-
-
-        vel(a1) = 0.9;
-
-        psi(a1) = 0.0;
-
-        g_load(a1) = 0.0;
-
-        // psi(a1) = 0.0;    // yaw
-        // theta(a1)  = 0.0;  // pitch
-        // phi(a1) = 0.0;    // roll
-        // phi_c(a1) = 0.0;  // target roll
-
-
-        roll_rate(a1) = 0.174;
-        pitch_rate(a1) = 0.012;
-        yaw_rate(a1) = 0.0;
-
-        speed_rate(a1) = 1.0;
-
-        // speed_control_cruising(a1) = true;
-        // speed_control_accelerating(a1) = false;
-        // speed_control_decelerating(a1) = false;
-
-        goal_x(a1) = 100.0;
-        goal_y(a1) = 100.0;
-        goal_z(a1) = 0.0;
- 
-	};
-
-	max-nondef-actions = 1;
-	horizon  = 400;
-	discount = 1.0;
-}
\ No newline at end of file
diff --git a/Competition/Drone_con/domain.rddl b/Competition/Drone_con/domain.rddl
new file mode 100644
index 00000000..04b7cfe9
--- /dev/null
+++ b/Competition/Drone_con/domain.rddl
@@ -0,0 +1,95 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Drone RDDL domain
+//
+///////////////////////////////////////////////////////////////////////////////
+
+domain simple_drone{
+
+types {
+    aircraft : object;
+
+};
+
+pvariables {
+
+    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
+
+    // Bounds on the position of the aircraft
+    MIN_X : { non-fluent, real, default = -50000.0};
+    MAX_X : { non-fluent, real, default = 50000.0};
+    MIN_Y : { non-fluent, real, default = -50000.0};
+    MAX_Y : { non-fluent, real, default = 50000.0};
+    MIN_Z : { non-fluent, real, default = -50000.0};
+    MAX_Z : { non-fluent, real, default = 50000.0};
+
+    GRAVITY : { non-fluent, real, default = 9.8};
+
+    SCALE_FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
+
+    // bounds on actions
+    MIN_VEL(aircraft) : {non-fluent, real, default = -1.0};
+    MAX_VEL(aircraft) : {non-fluent, real, default = 1.0};
+    MIN_PHI(aircraft) : {non-fluent, real, default = -1.0};
+    MAX_PHI(aircraft) : {non-fluent, real, default = 1.0};
+    MIN_THETA(aircraft) : {non-fluent, real, default = -1.0};
+    MAX_THETA(aircraft) : {non-fluent, real, default = 1.0};
+
+    // goal position
+    GOAL_X(aircraft) : {non-fluent, real, default = 100.0};
+    GOAL_Y(aircraft) : {non-fluent, real, default = 100.0};
+    GOAL_Z(aircraft) : {non-fluent, real, default = 100.0};
+    
+    // Coordinates
+    pos_x(aircraft) : { state-fluent, real, default = 0.0 };
+    pos_y(aircraft) : { state-fluent, real, default = 0.0 }; 
+    pos_z(aircraft) : { state-fluent, real, default = 0.0 };
+
+    // velocity
+    vel(aircraft) : { state-fluent, real, default = 1.0 };
+
+    // Control variables
+    theta(aircraft) : { state-fluent, real, default = 0.0 };  // pitch
+    phi(aircraft) : { state-fluent, real, default = 0.0 };    // roll
+    psi(aircraft) : { state-fluent, real, default = 0.0 };    // yaw
+
+    // actions
+    set_vel(aircraft)  :  { action-fluent, real, default = 0.0 };
+    set_phi(aircraft)  :  { action-fluent, real, default = 0.0 };
+    set_theta(aircraft)  :  { action-fluent, real, default = 0.0 };
+   
+};
+
+cpfs {
+
+    // position changes for each time step
+    pos_x'(?a) = pos_x(?a) + SCALE_FACTOR * vel(?a) * cos[psi(?a)];
+    pos_y'(?a) = pos_y(?a) + SCALE_FACTOR * vel(?a) * sin[psi(?a)];
+    pos_z'(?a) = pos_z(?a) + SCALE_FACTOR * vel(?a) * sin[theta(?a)];
+
+    // velocity
+    vel'(?a) = vel(?a) + SCALE_FACTOR * max[min[set_vel(?a), MAX_VEL(?a)], MIN_VEL(?a)];
+
+    // angle changes
+    phi'(?a) = phi(?a) + SCALE_FACTOR * max[min[set_phi(?a), MAX_PHI(?a)], MIN_PHI(?a)];
+    theta'(?a) = theta(?a) + SCALE_FACTOR * max[min[set_theta(?a), MAX_THETA(?a)], MIN_THETA(?a)];
+    psi'(?a) = psi(?a) + SCALE_FACTOR * (tan[phi(?a)] / vel(?a)) * GRAVITY;
+
+};
+
+reward = sum_{?a : aircraft} [ 1 / (sqrt[pow[(pos_x(?a) - GOAL_X(?a)),2] + 
+                                   pow[(pos_y(?a) - GOAL_Y(?a)),2] +
+                                   pow[(pos_z(?a) - GOAL_Z(?a)),2]]) ];
+
+action-preconditions {
+    // boundries of the aircarft locations
+    forall_{?a : aircraft}[ pos_x(?a) <= MAX_X ^ pos_x(?a) >= MIN_X ^
+                            pos_y(?a) <= MAX_Y ^ pos_y(?a) >= MIN_Y ^
+                            pos_z(?a) <= MAX_Z ^ pos_x(?a) >= MIN_Z ];
+    // boundries for set vel 
+    forall_{?a : aircraft}[ set_vel(?a) <= MAX_VEL(?a) ^ set_vel(?a) >= MIN_VEL(?a)];
+    forall_{?a : aircraft}[ set_phi(?a) <= MAX_PHI(?a) ^ set_phi(?a) >= MIN_PHI(?a)];
+    forall_{?a : aircraft}[ set_theta(?a) <= MAX_THETA(?a) ^ set_theta(?a) >= MIN_THETA(?a)];
+};
+
+}
\ No newline at end of file
diff --git a/Competition/Drone_con/insta0.rddl b/Competition/Drone_con/insta0.rddl
new file mode 100644
index 00000000..255c8f24
--- /dev/null
+++ b/Competition/Drone_con/insta0.rddl
@@ -0,0 +1,60 @@
+non-fluents nf_simple_drone_p0{
+	domain = simple_drone;
+
+	objects {
+		aircraft : {a1};
+	};
+
+	non-fluents {
+        // Bounds on the position of the aircraft
+        MIN_X = -50000.0;
+        MAX_X = 500000.0;
+        MIN_Y = -500000.0;
+        MAX_Y = 500000.0;
+        MIN_Z = -50000.0;
+        MAX_Z = 50000.0;
+
+        GRAVITY = 9.8;
+
+        SCALE_FACTOR = 0.1;
+
+        // Speed bounds
+        MIN_VEL(a1) = -1.0;
+        MAX_VEL(a1) = 1.0;
+        MIN_PHI(a1) = -1.0;
+        MAX_PHI(a1) = 1.0;
+        MIN_THETA(a1) = -1.0;
+        MAX_THETA(a1) = 1.0;
+
+        GOAL_X(a1) = 50.0;
+        GOAL_Y(a1) = 50.0;
+        GOAL_z(a1) = 50.0;
+
+        CONTROLLABLE(a1);
+	};
+}
+
+instance simple_drone_p0 {
+	domain = simple_drone;
+	non-fluents = nf_simple_drone_p0;
+	
+	init-state {
+	pos_x(a1) = 0.0;
+        pos_y(a1) = 0.0;
+        pos_z(a1) = 0.0;
+
+
+        vel(a1) = 0.1;
+
+        psi(a1) = 0.0;
+        phi(a1) = 0.0;
+        theta(a1) = 0.0;
+
+
+ 	};
+
+	max-nondef-actions = pos-inf;
+	horizon  = 20;
+	discount = 1.0;
+
+}
\ No newline at end of file
diff --git a/Competition/Drone_dis/domain.rddl b/Competition/Drone_dis/domain.rddl
new file mode 100644
index 00000000..1e3f3c05
--- /dev/null
+++ b/Competition/Drone_dis/domain.rddl
@@ -0,0 +1,97 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Drone RDDL domain
+//
+///////////////////////////////////////////////////////////////////////////////
+
+domain simple_drone{
+
+types {
+    aircraft : object;
+
+};
+
+pvariables {
+
+    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
+
+    // Bounds on the position of the aircraft
+    MIN_X : { non-fluent, real, default = -50000.0};
+    MAX_X : { non-fluent, real, default = 50000.0};
+    MIN_Y : { non-fluent, real, default = -50000.0};
+    MAX_Y : { non-fluent, real, default = 50000.0};
+    MIN_Z : { non-fluent, real, default = -50000.0};
+    MAX_Z : { non-fluent, real, default = 50000.0};
+
+    GRAVITY : { non-fluent, real, default = 9.8};
+
+    SCALE_FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
+
+    // bounds for Rates
+    MIN_VEL(aircraft) : {non-fluent, int, default = -1};
+    MAX_VEL(aircraft) : {non-fluent, int, default = 1};
+    MIN_PHI(aircraft) : {non-fluent, int, default = -1};
+    MAX_PHI(aircraft) : {non-fluent, int, default = 1};
+    MIN_THETA(aircraft) : {non-fluent, int, default = -1};
+    MAX_THETA(aircraft) : {non-fluent, int, default = 1};
+
+    // goal position
+    GOAL_X(aircraft) : {non-fluent, real, default = 100.0};
+    GOAL_Y(aircraft) : {non-fluent, real, default = 100.0};
+    GOAL_Z(aircraft) : {non-fluent, real, default = 100.0};
+    
+    // Coordinates
+    pos_x(aircraft) : { state-fluent, real, default = 0.0 };
+    pos_y(aircraft) : { state-fluent, real, default = 0.0 }; 
+    pos_z(aircraft) : { state-fluent, real, default = 0.0 };
+
+    // velocity
+    vel(aircraft) : { state-fluent, real, default = 1.0 };
+
+    // Control variables
+    theta(aircraft) : { state-fluent, real, default = 0.0 };  // pitch
+    phi(aircraft) : { state-fluent, real, default = 0.0 };    // roll
+    psi(aircraft) : { state-fluent, real, default = 0.0 };    // yaw
+
+    // actions
+    set_vel(aircraft)  :  { action-fluent, int, default = 0 };
+    set_phi(aircraft)  :  { action-fluent, int, default = 0 };
+    set_theta(aircraft)  :  { action-fluent, int, default = 0 };
+   
+};
+
+cpfs {
+
+    // position changes for each time step
+    pos_x'(?a) = pos_x(?a) + SCALE_FACTOR * vel(?a) * cos[psi(?a)];
+    pos_y'(?a) = pos_y(?a) + SCALE_FACTOR * vel(?a) * sin[psi(?a)];
+    pos_z'(?a) = pos_z(?a) + SCALE_FACTOR * vel(?a) * sin[theta(?a)];
+    
+    // velocity
+    vel'(?a) = vel(?a) + SCALE_FACTOR * max[min[set_vel(?a), MAX_VEL(?a)], MIN_VEL(?a)];
+
+    // angle changes
+    phi'(?a) = phi(?a) + SCALE_FACTOR * max[min[set_phi(?a), MAX_PHI(?a)], MIN_PHI(?a)];
+    theta'(?a) = theta(?a) + SCALE_FACTOR * max[min[set_theta(?a), MAX_THETA(?a)], MIN_THETA(?a)];
+    psi'(?a) = psi(?a) + SCALE_FACTOR * (tan[phi(?a)] / vel(?a)) * GRAVITY;
+
+};
+
+reward = sum_{?a : aircraft} [ 1 / (sqrt[pow[(pos_x(?a) - GOAL_X(?a)),2] + 
+                                   pow[(pos_y(?a) - GOAL_Y(?a)),2] +
+                                   pow[(pos_z(?a) - GOAL_Z(?a)),2]]) ];
+
+action-preconditions {
+    // boundries of the aircarft locations
+    forall_{?a : aircraft}[ pos_x(?a) <= MAX_X ^ pos_x(?a) >= MIN_X ^
+                            pos_y(?a) <= MAX_Y ^ pos_y(?a) >= MIN_Y ^
+                            pos_z(?a) <= MAX_Z ^ pos_x(?a) >= MIN_Z ];
+
+    // boundries for set vel 
+    forall_{?a : aircraft}[ set_vel(?a) <= MAX_VEL(?a) ^ set_vel(?a) >= MIN_VEL(?a)];
+    forall_{?a : aircraft}[ set_phi(?a) <= MAX_PHI(?a) ^ set_phi(?a) >= MIN_PHI(?a)];
+    forall_{?a : aircraft}[ set_theta(?a) <= MAX_THETA(?a) ^ set_theta(?a) >= MIN_THETA(?a)];
+
+};
+
+}
\ No newline at end of file
diff --git a/Competition/Drone_dis/insta0.rddl b/Competition/Drone_dis/insta0.rddl
new file mode 100644
index 00000000..511cc65f
--- /dev/null
+++ b/Competition/Drone_dis/insta0.rddl
@@ -0,0 +1,52 @@
+non-fluents nf_simple_drone_p0{
+	domain = simple_drone;
+
+	objects {
+		aircraft : {a1};
+	};
+
+	non-fluents {
+        // Bounds on the position of the aircraft
+        MIN_X = -50000.0;
+        MAX_X = 500000.0;
+        MIN_Y = -500000.0;
+        MAX_Y = 500000.0;
+        MIN_Z = -50000.0;
+        MAX_Z = 50000.0;
+
+        GRAVITY = 9.8;
+
+        SCALE_FACTOR = 0.1;
+
+        GOAL_X(a1) = 50.0;
+        GOAL_Y(a1) = 50.0;
+        GOAL_z(a1) = 50.0;
+
+        CONTROLLABLE(a1);
+	};
+}
+
+instance simple_drone_p0 {
+	domain = simple_drone;
+	non-fluents = nf_simple_drone_p0;
+	
+	init-state {
+	pos_x(a1) = 0.0;
+        pos_y(a1) = 0.0;
+        pos_z(a1) = 0.0;
+
+
+        vel(a1) = 0.1;
+
+        psi(a1) = 0.0;
+        phi(a1) = 0.0;
+        theta(a1) = 0.0;
+
+
+ 	};
+
+	max-nondef-actions = pos-inf;
+	horizon  = 20;
+	discount = 1.0;
+
+}
\ No newline at end of file
diff --git a/Competition/Drone_mix/domain.rddl b/Competition/Drone_mix/domain.rddl
new file mode 100644
index 00000000..7644d0ba
--- /dev/null
+++ b/Competition/Drone_mix/domain.rddl
@@ -0,0 +1,97 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// Drone RDDL domain
+//
+///////////////////////////////////////////////////////////////////////////////
+
+domain simple_drone{
+
+types {
+    aircraft : object;
+
+};
+
+pvariables {
+
+    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
+
+    // Bounds on the position of the aircraft
+    MIN_X : { non-fluent, real, default = -50000.0};
+    MAX_X : { non-fluent, real, default = 50000.0};
+    MIN_Y : { non-fluent, real, default = -50000.0};
+    MAX_Y : { non-fluent, real, default = 50000.0};
+    MIN_Z : { non-fluent, real, default = -50000.0};
+    MAX_Z : { non-fluent, real, default = 50000.0};
+
+    GRAVITY : { non-fluent, real, default = 9.8};
+
+    SCALE_FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
+
+    // bounds for Rates
+    MIN_VEL(aircraft) : {non-fluent, int, default = -1};
+    MAX_VEL(aircraft) : {non-fluent, int, default = 1};
+    MIN_PHI(aircraft) : {non-fluent, real, default = -1.0};
+    MAX_PHI(aircraft) : {non-fluent, real, default = 1.0};
+    MIN_THETA(aircraft) : {non-fluent, real, default = -1.0};
+    MAX_THETA(aircraft) : {non-fluent, real, default = 1.0};
+
+    // goal position
+    GOAL_X(aircraft) : {non-fluent, real, default = 100.0};
+    GOAL_Y(aircraft) : {non-fluent, real, default = 100.0};
+    GOAL_Z(aircraft) : {non-fluent, real, default = 100.0};
+    
+    // Coordinates
+    pos_x(aircraft) : { state-fluent, real, default = 0.0 };
+    pos_y(aircraft) : { state-fluent, real, default = 0.0 }; 
+    pos_z(aircraft) : { state-fluent, real, default = 0.0 };
+
+    // velocity
+    vel(aircraft) : { state-fluent, real, default = 1.0 };
+
+    // Control variables
+    theta(aircraft) : { state-fluent, real, default = 0.0 };  // pitch
+    phi(aircraft) : { state-fluent, real, default = 0.0 };    // roll
+    psi(aircraft) : { state-fluent, real, default = 0.0 };    // yaw
+
+    // actions
+    set_vel(aircraft)  :  { action-fluent, int, default = 0 };
+    set_phi(aircraft)  :  { action-fluent, real, default = 0.0 };
+    set_theta(aircraft)  :  { action-fluent, real, default = 0.0 };
+   
+};
+
+cpfs {
+
+    // position changes for each time step
+    pos_x'(?a) = pos_x(?a) + SCALE_FACTOR * vel(?a) * cos[psi(?a)];
+    pos_y'(?a) = pos_y(?a) + SCALE_FACTOR * vel(?a) * sin[psi(?a)];
+    pos_z'(?a) = pos_z(?a) + SCALE_FACTOR * vel(?a) * sin[theta(?a)];
+    
+    // velocity
+    vel'(?a) = vel(?a) + SCALE_FACTOR * max[min[set_vel(?a), MAX_VEL(?a)], MIN_VEL(?a)];
+
+    // angle changes
+    phi'(?a) = phi(?a) + SCALE_FACTOR * max[min[set_phi(?a), MAX_PHI(?a)], MIN_PHI(?a)];
+    theta'(?a) = theta(?a) + SCALE_FACTOR * max[min[set_theta(?a), MAX_THETA(?a)], MIN_THETA(?a)];
+    psi'(?a) = psi(?a) + SCALE_FACTOR * (tan[phi(?a)] / vel(?a)) * GRAVITY;
+
+};
+
+reward = sum_{?a : aircraft} [ 1 / (sqrt[pow[(pos_x(?a) - GOAL_X(?a)),2] + 
+                                   pow[(pos_y(?a) - GOAL_Y(?a)),2] +
+                                   pow[(pos_z(?a) - GOAL_Z(?a)),2]]) ];
+
+action-preconditions {
+    // boundries of the aircarft locations
+    forall_{?a : aircraft}[ pos_x(?a) <= MAX_X ^ pos_x(?a) >= MIN_X ^
+                            pos_y(?a) <= MAX_Y ^ pos_y(?a) >= MIN_Y ^
+                            pos_z(?a) <= MAX_Z ^ pos_x(?a) >= MIN_Z ];
+
+    // boundries for set vel 
+    forall_{?a : aircraft}[ set_vel(?a) <= MAX_VEL(?a) ^ set_vel(?a) >= MIN_VEL(?a)];
+    forall_{?a : aircraft}[ set_phi(?a) <= MAX_PHI(?a) ^ set_phi(?a) >= MIN_PHI(?a)];
+    forall_{?a : aircraft}[ set_theta(?a) <= MAX_THETA(?a) ^ set_theta(?a) >= MIN_THETA(?a)];
+
+};
+
+}
\ No newline at end of file
diff --git a/Competition/Drone_mix/insta0.rddl b/Competition/Drone_mix/insta0.rddl
new file mode 100644
index 00000000..511cc65f
--- /dev/null
+++ b/Competition/Drone_mix/insta0.rddl
@@ -0,0 +1,52 @@
+non-fluents nf_simple_drone_p0{
+	domain = simple_drone;
+
+	objects {
+		aircraft : {a1};
+	};
+
+	non-fluents {
+        // Bounds on the position of the aircraft
+        MIN_X = -50000.0;
+        MAX_X = 500000.0;
+        MIN_Y = -500000.0;
+        MAX_Y = 500000.0;
+        MIN_Z = -50000.0;
+        MAX_Z = 50000.0;
+
+        GRAVITY = 9.8;
+
+        SCALE_FACTOR = 0.1;
+
+        GOAL_X(a1) = 50.0;
+        GOAL_Y(a1) = 50.0;
+        GOAL_z(a1) = 50.0;
+
+        CONTROLLABLE(a1);
+	};
+}
+
+instance simple_drone_p0 {
+	domain = simple_drone;
+	non-fluents = nf_simple_drone_p0;
+	
+	init-state {
+	pos_x(a1) = 0.0;
+        pos_y(a1) = 0.0;
+        pos_z(a1) = 0.0;
+
+
+        vel(a1) = 0.1;
+
+        psi(a1) = 0.0;
+        phi(a1) = 0.0;
+        theta(a1) = 0.0;
+
+
+ 	};
+
+	max-nondef-actions = pos-inf;
+	horizon  = 20;
+	discount = 1.0;
+
+}
\ No newline at end of file


Test patch:
diff --git a/testGymDrone.py b/testGymDrone.py
new file mode 100644
index 00000000..a09bcc75
--- /dev/null
+++ b/testGymDrone.py
@@ -0,0 +1,39 @@
+from Env import RDDLEnv as RDDLEnv
+from Policies.Agents import RandomAgent
+import numpy as np
+import random
+
+FOLDER = 'Competition/Drone_mix/'
+
+
+def main():
+    steps = 1000
+    myEnv = RDDLEnv.RDDLEnv(domain=FOLDER + 'domain.rddl', instance=FOLDER + 'insta0.rddl', is_grounded=False)
+    agent = RandomAgent(action_space=myEnv.action_space, num_actions=myEnv.NumConcurrentActions)
+    
+    from pprint import pprint
+    pprint(vars(myEnv.model))
+    
+    total_reward = 0
+    state = myEnv.reset()
+    for step in range(steps):
+        myEnv.render()
+        action = agent.sample_action()
+
+        next_state, reward, done, info = myEnv.step(action)
+        total_reward += reward
+        # print("step {}: reward: {}".format(step, reward))
+        # print("state_i:", state, "-> state_f:", next_state)
+        print("\nstep = {}".format(step))
+        print('reward = {}'.format(reward))
+        print('state = {}'.format(state))
+        print('action = {}'.format(action))
+        print('next_state = {}'.format(next_state))
+        print('derived = {}'.format(myEnv.model.derived))
+        print('interm = {}'.format(myEnv.model.interm))
+        state = next_state
+    print("episode ended with reward {}".format(total_reward))
+
+
+if __name__ == "__main__":
+    main()