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

Issue:
Ayals branch2



Discussion / hints:

Fix patch:
diff --git a/Competition/Cartpole/domain.rddl b/Competition/Cartpole/domain.rddl
index 10173131..1504bef3 100644
--- a/Competition/Cartpole/domain.rddl
+++ b/Competition/Cartpole/domain.rddl
@@ -17,80 +17,80 @@ domain cart_pole {
 
     	// forces
 		GRAVITY   : { non-fluent, real, default = 9.8 };        // force of gravity acting down
-		FORCE_MAG : { non-fluent, real, default = 10.0 };		// force applied to the side of the cart
+		FORCE-MAG : { non-fluent, real, default = 10.0 };		// force applied to the side of the cart
 
 		// cart and pole properties
-		CART_MASS : { non-fluent, real, default = 1.0 };        // mass of the cart
-		POLE_MASS : { non-fluent, real, default = 0.1 };		// mass of the pole
-		POLE_LEN  : { non-fluent, real, default = 0.5 }; 		// half of the pole length
+		CART-MASS : { non-fluent, real, default = 1.0 };        // mass of the cart
+		POLE-MASS : { non-fluent, real, default = 0.1 };		// mass of the pole
+		POLE-LEN  : { non-fluent, real, default = 0.5 }; 		// half of the pole length
 		
 		// other constants
-		TIME_STEP : { non-fluent, real, default = 0.02 }; 		// seconds between state updates
-		POS_LIMIT : { non-fluent, real, default = 2.4 };		// limit of cart position
-		ANG_LIMIT : { non-fluent, real, default = 0.2094395 };	// limit of pole angle
+		TIME-STEP : { non-fluent, real, default = 0.02 }; 		// seconds between state updates
+		POS-LIMIT : { non-fluent, real, default = 2.4 };		// limit of cart position
+		ANG-LIMIT : { non-fluent, real, default = 0.2094395 };	// limit of pole angle
 	
 		// interm & derived fluents
 		force : { derived-fluent, real };                       // actual signed force applied to the cart
 		temp : { derived-fluent, real };						// temporary variable
 		acc : { derived-fluent, real };							// position acceleration
-		ang_acc : { derived-fluent, real };						// angular acceleration
-		out_of_bounds : { derived-fluent, bool };				// whether the system is out of bounds
+		ang-acc : { derived-fluent, real };						// angular acceleration
+		out-of-bounds : { derived-fluent, bool };				// whether the system is out of bounds
 		increment : { derived-fluent, real };					// actual state increment accounting for out of bounds
 		
 		// states
        	pos    	: { state-fluent, real, default = 0 };          // cart position
-       	ang_pos	: { state-fluent, real, default = 0 };          // pole angle
+       	ang-pos	: { state-fluent, real, default = 0 };          // pole angle
        	vel   	: { state-fluent, real, default = 0 };          // cart velocity
-       	ang_vel : { state-fluent, real, default = 0 };          // pole angular velocity
+       	ang-vel : { state-fluent, real, default = 0 };          // pole angular velocity
 
        	// actions
-       	force_side : { action-fluent, int, default = 0 };      	// whether to apply force to left, right side or none
+       	force-side : { action-fluent, int, default = 0 };      	// whether to apply force to left, right side or none
        	//test : { action-fluent, bool, default = false };      	// whether to apply force to left, right side or none
     };
 
     cpfs {
 		// the actual signed force on the cart
-		force = if(force_side == 1)
-				 then FORCE_MAG
-				 else -FORCE_MAG;
+		force = if(force-side == 1)
+				 then FORCE-MAG
+				 else -FORCE-MAG;
 		
 		// compute the pole angular acceleration
-		temp = (force + POLE_LEN * pow[ang_vel, 2] * sin[ang_pos]) / (CART_MASS + POLE_MASS);
-		ang_acc = (GRAVITY * sin[ang_pos] - cos[ang_pos] * temp) / (
-            POLE_LEN * ((4.0 / 3.0) - (POLE_MASS * pow[cos[ang_pos], 2] / (CART_MASS + POLE_MASS))));
+		temp = (force + POLE-LEN * pow[ang-vel, 2] * sin[ang-pos]) / (CART-MASS + POLE-MASS);
+		ang-acc = (GRAVITY * sin[ang-pos] - cos[ang-pos] * temp) / (
+            POLE-LEN * ((4.0 / 3.0) - (POLE-MASS * pow[cos[ang-pos], 2] / (CART-MASS + POLE-MASS))));
 		
 		// compute the cart acceleration
-		acc = temp - (POLE_LEN * ang_acc * cos[ang_pos] / (CART_MASS + POLE_MASS));
+		acc = temp - (POLE-LEN * ang-acc * cos[ang-pos] / (CART-MASS + POLE-MASS));
 		
 		// out of bounds checks
-		out_of_bounds = (pos <= -POS_LIMIT) | (pos >= POS_LIMIT) | (ang_pos <= -ANG_LIMIT) | (ang_pos >= ANG_LIMIT);
+		out-of-bounds = (pos <= -POS-LIMIT) | (pos >= POS-LIMIT) | (ang-pos <= -ANG-LIMIT) | (ang-pos >= ANG-LIMIT);
 		
 		// if out of bounds, do not update the state
-		increment = if(out_of_bounds)
+		increment = if(out-of-bounds)
 						then 0.0
-						else TIME_STEP;
+						else TIME-STEP;
 
 		// Euler integration formula
-		pos' = max[min[pos + increment * vel, POS_LIMIT], -POS_LIMIT];		
-		ang_pos' = max[min[ang_pos + increment * ang_vel, ANG_LIMIT], -ANG_LIMIT];
+		pos' = max[min[pos + increment * vel, POS-LIMIT], -POS-LIMIT];
+		ang-pos' = max[min[ang-pos + increment * ang-vel, ANG-LIMIT], -ANG-LIMIT];
 		vel' = vel + increment * acc;
-		ang_vel' = ang_vel + increment * ang_acc;
+		ang-vel' = ang-vel + increment * ang-acc;
     };
 
     // R = 1 as long as the pole is upright and the cart is not out of bounds
-    reward = if(out_of_bounds)
+    reward = if(out-of-bounds)
 				then 0.0
 				else 1.0;
 
     state-invariants {
-		pos >= -POS_LIMIT ^ pos <= POS_LIMIT;
-		ang_pos >= -ANG_LIMIT ^ ang_pos <= ANG_LIMIT;
+		pos >= -POS-LIMIT ^ pos <= POS-LIMIT;
+		ang-pos >= -ANG-LIMIT ^ ang-pos <= ANG-LIMIT;
     };
 
     action-preconditions {
-        force_side <= 1;
-        force_side >= 0;
-		//(force_side == 0) | (force_side == 1);
+        force-side <= 1;
+        force-side >= 0;
+		//(force-side == 0) | (force-side == 1);
     };
 
 }
diff --git a/Competition/Cartpole/instance0.rddl b/Competition/Cartpole/instance0.rddl
index 693a1435..c16dc1c3 100644
--- a/Competition/Cartpole/instance0.rddl
+++ b/Competition/Cartpole/instance0.rddl
@@ -22,8 +22,8 @@ instance inst_cart_pole {
 	init-state {
 	    pos = 0.0;
         vel = 0.0;
-        ang_pos = 0.0;
-        ang_vel = 0.0;
+        ang-pos = 0.0;
+        ang-vel = 0.0;
 	};
 
   	// State-action constraints above are sufficient
diff --git a/Competition/Drone_con/domain.rddl b/Competition/Drone_con/domain.rddl
deleted file mode 100644
index 9d4d08d5..00000000
--- a/Competition/Drone_con/domain.rddl
+++ /dev/null
@@ -1,118 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-//
-// Drone RDDL domain
-//
-///////////////////////////////////////////////////////////////////////////////
-
-domain kinematic_drones_con{
-
-types {
-    aircraft : object;
-};
-
-pvariables {
-
-    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
-    GRAVITY : { non-fluent, real, default = 9.8};
-
-    // 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};
-
-    SCALE_FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
-    RANDOM_WALK_COEFF : {non-fluent, real, default = 0.1 };       // variance constant for random walk of non controllable drones
-    VEL_REG     : {non-fluent, real, default = 0.001};            // regularizatino factor when dividing by zero velocity
-
-    // bounds on actions
-    MIN_ACC(aircraft) : {non-fluent, real, default = -1.0};
-    MAX_ACC(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};
-
-    // States
-    // Cartesian Coordinates
-    pos_x(aircraft) : { state-fluent, real, default = 0.0 }; // X axis coordinate
-    pos_y(aircraft) : { state-fluent, real, default = 0.0 }; // Y axis coordinate
-    pos_z(aircraft) : { state-fluent, real, default = 0.0 }; // Z axis coordinate
-    // Angles
-    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
-    // velocity
-    vel(aircraft) : { state-fluent, real, default = 1.0 }; // velocity in the direction of the nose
-
-    // actions
-    set_acc(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) = if (CONTROLLABLE(?a))
-                 then pos_x(?a) + SCALE_FACTOR * vel(?a) * cos[psi(?a)]
-                 else pos_x(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    pos_y'(?a) = if (CONTROLLABLE(?a))
-                 then pos_y(?a) + SCALE_FACTOR * vel(?a) * sin[psi(?a)]
-                 else pos_y(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    pos_z'(?a) = if (CONTROLLABLE(?a))
-                 then pos_z(?a) + SCALE_FACTOR * vel(?a) * sin[theta(?a)]
-                 else pos_z(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-
-    // velocity
-    vel'(?a) = if (CONTROLLABLE(?a))
-               then max[0, vel(?a) + SCALE_FACTOR * max[min[set_acc(?a), MAX_ACC(?a)], MIN_ACC(?a)]]
-               else max[0, vel(?a) + Normal(0.0, RANDOM_WALK_COEFF)];
-
-    // angle changes
-    phi'(?a) = if (CONTROLLABLE(?a))
-               then phi(?a) + SCALE_FACTOR * max[min[set_phi(?a), MAX_PHI(?a)], MIN_PHI(?a)]
-               else phi(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    theta'(?a) = if (CONTROLLABLE(?a))
-                 then theta(?a) + SCALE_FACTOR * max[min[set_theta(?a), MAX_THETA(?a)], MIN_THETA(?a)]
-                 else theta(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    psi'(?a) = if (CONTROLLABLE(?a))
-               then psi(?a) + SCALE_FACTOR * (tan[phi(?a)] / (vel(?a)+VEL_REG)) * GRAVITY
-               else psi(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-
-};
-
-reward = -sum_{?a : aircraft} [CONTROLLABLE(?a) * [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]]] ];
-
-
-state-invariants {
-    // boundaries of the aircraft locations
-    forall_{?a : aircraft}[ pos_x(?a) <= MAX_X ];
-    forall_{?a : aircraft}[ pos_x(?a) >= MIN_X ];
-    forall_{?a : aircraft}[ pos_y(?a) <= MAX_Y ];
-    forall_{?a : aircraft}[ pos_y(?a) >= MIN_Y ];
-    forall_{?a : aircraft}[ pos_z(?a) <= MAX_Z ];
-    forall_{?a : aircraft}[ pos_z(?a) >= MIN_Z ];
-};
-
-action-preconditions {
-    // boundaries for set acc
-    //forall_{?a : aircraft}[ set_acc(?a) <= MAX_ACC(?a)];
-    forall_{?a : aircraft}[ set_acc(?a) >= MIN_ACC(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) <= MAX_PHI(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) >= MIN_PHI(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) <= MAX_THETA(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) >= MIN_THETA(?a)];
-};
-
-}
\ No newline at end of file
diff --git a/Competition/Drone_con/domain_old.rddl b/Competition/Drone_con/domain_old.rddl
deleted file mode 100644
index f4a10ea4..00000000
--- a/Competition/Drone_con/domain_old.rddl
+++ /dev/null
@@ -1,103 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-//
-// Drone RDDL domain
-//
-///////////////////////////////////////////////////////////////////////////////
-
-domain kinematic_drones_con{
-
-types {
-    aircraft : object;
-};
-
-pvariables {
-
-    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
-    GRAVITY : { non-fluent, real, default = 9.8};
-
-    // 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};
-
-    SCALE_FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
-    VEL_REG     : {non-fluent, real, default = 0.001};            // regularizatino factor when dividing by zero velocity
-
-    // bounds on actions
-    MIN_ACC(aircraft) : {non-fluent, real, default = -1.0};
-    MAX_ACC(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};
-
-    // States
-    // Cartesian Coordinates
-    pos_x(aircraft) : { state-fluent, real, default = 0.0 }; // X axis coordinate
-    pos_y(aircraft) : { state-fluent, real, default = 0.0 }; // Y axis coordinate
-    pos_z(aircraft) : { state-fluent, real, default = 0.0 }; // Z axis coordinate
-    // Angles
-    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
-    // velocity
-    vel(aircraft) : { state-fluent, real, default = 1.0 }; // velocity in the direction of the nose
-
-    // actions
-    set_acc(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_acc(?a), MAX_ACC(?a)], MIN_ACC(?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)+VEL_REG)) * GRAVITY;
-
-};
-
-reward = -sum_{?a : aircraft} [CONTROLLABLE(?a) * [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]]] ];
-
-//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]]) ];
-
-state-invariants {
-    // boundaries of the aircraft 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 ];
-    };
-
-action-preconditions {
-    // boundaries for set acc
-    forall_{?a : aircraft}[ set_acc(?a) <= MAX_ACC(?a)];
-    forall_{?a : aircraft}[ set_acc(?a) >= MIN_ACC(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) <= MAX_PHI(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) >= MIN_PHI(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) <= MAX_THETA(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) >= MIN_THETA(?a)];
-};
-
-}
\ No newline at end of file
diff --git a/Competition/Drone_con/instance0.rddl b/Competition/Drone_con/instance0.rddl
deleted file mode 100644
index f677bf0f..00000000
--- a/Competition/Drone_con/instance0.rddl
+++ /dev/null
@@ -1,60 +0,0 @@
-non-fluents nf_simple_drone_p0{
-	domain = kinematic_drones_con;
-
-	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 = kinematic_drones_con;
-	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_con/instance1.rddl b/Competition/Drone_con/instance1.rddl
deleted file mode 100644
index fc166832..00000000
--- a/Competition/Drone_con/instance1.rddl
+++ /dev/null
@@ -1,60 +0,0 @@
-non-fluents nf_simple_drone_p0{
-	domain = kinematic_drones_con;
-
-	objects {
-		aircraft : {a1, a2, a3};
-	};
-
-	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 = kinematic_drones_con;
-	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
deleted file mode 100644
index 413ae389..00000000
--- a/Competition/Drone_dis/domain.rddl
+++ /dev/null
@@ -1,117 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-//
-// Drone RDDL domain
-//
-///////////////////////////////////////////////////////////////////////////////
-
-domain kinematic_drones_dis{
-
-types {
-    aircraft : object;
-};
-
-pvariables {
-
-    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
-    GRAVITY : { non-fluent, real, default = 9.8};
-
-    // 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};
-
-    SCALE_FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
-    RANDOM_WALK_COEFF : {non-fluent, real, default = 0.1 };       // variance constant for random walk of non controllable drones
-    VEL_REG     : {non-fluent, real, default = 0.001};            // regularizatino factor when dividing by zero velocity
-
-    // bounds on actions
-    MIN_ACC(aircraft) : {non-fluent, int, default = -1};
-    MAX_ACC(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};
-
-    // States
-    // Cartesian Coordinates
-    pos_x(aircraft) : { state-fluent, real, default = 0.0 }; // X axis coordinate
-    pos_y(aircraft) : { state-fluent, real, default = 0.0 }; // Y axis coordinate
-    pos_z(aircraft) : { state-fluent, real, default = 0.0 }; // Z axis coordinate
-    // Angles
-    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
-    // velocity
-    vel(aircraft) : { state-fluent, real, default = 1.0 }; // velocity in the direction of the nose
-
-    // actions
-    set_acc(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) = if (CONTROLLABLE(?a))
-                 then pos_x(?a) + SCALE_FACTOR * vel(?a) * cos[psi(?a)]
-                 else pos_x(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    pos_y'(?a) = if (CONTROLLABLE(?a))
-                 then pos_y(?a) + SCALE_FACTOR * vel(?a) * sin[psi(?a)]
-                 else pos_y(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    pos_z'(?a) = if (CONTROLLABLE(?a))
-                 then pos_z(?a) + SCALE_FACTOR * vel(?a) * sin[theta(?a)]
-                 else pos_z(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-
-    // velocity
-    vel'(?a) = if (CONTROLLABLE(?a))
-               then max[0, vel(?a) + SCALE_FACTOR * max[min[set_acc(?a), MAX_ACC(?a)], MIN_ACC(?a)]]
-               else max[0, vel(?a) + Normal(0.0, RANDOM_WALK_COEFF)];
-
-    // angle changes
-    phi'(?a) = if (CONTROLLABLE(?a))
-               then phi(?a) + SCALE_FACTOR * max[min[set_phi(?a), MAX_PHI(?a)], MIN_PHI(?a)]
-               else phi(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    theta'(?a) = if (CONTROLLABLE(?a))
-                 then theta(?a) + SCALE_FACTOR * max[min[set_theta(?a), MAX_THETA(?a)], MIN_THETA(?a)]
-                 else theta(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    psi'(?a) = if (CONTROLLABLE(?a))
-               then psi(?a) + SCALE_FACTOR * (tan[phi(?a)] / (vel(?a)+VEL_REG)) * GRAVITY
-               else psi(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-
-};
-
-reward = -sum_{?a : aircraft} [CONTROLLABLE(?a) * [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]]] ];
-
-state-invariants {
-    // boundaries of the aircraft locations
-    forall_{?a : aircraft}[ pos_x(?a) <= MAX_X ];
-    forall_{?a : aircraft}[ pos_x(?a) >= MIN_X ];
-    forall_{?a : aircraft}[ pos_y(?a) <= MAX_Y ];
-    forall_{?a : aircraft}[ pos_y(?a) >= MIN_Y ];
-    forall_{?a : aircraft}[ pos_z(?a) <= MAX_Z ];
-    forall_{?a : aircraft}[ pos_z(?a) >= MIN_Z ];
-};
-
-action-preconditions {
-    // boundaries for set acc
-    forall_{?a : aircraft}[ set_acc(?a) <= MAX_ACC(?a)];
-    forall_{?a : aircraft}[ set_acc(?a) >= MIN_ACC(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) <= MAX_PHI(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) >= MIN_PHI(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) <= MAX_THETA(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) >= MIN_THETA(?a)];
-};
-
-}
\ No newline at end of file
diff --git a/Competition/Drone_dis/domain_old.rddl b/Competition/Drone_dis/domain_old.rddl
deleted file mode 100644
index 5469e500..00000000
--- a/Competition/Drone_dis/domain_old.rddl
+++ /dev/null
@@ -1,103 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-//
-// Drone RDDL domain
-//
-///////////////////////////////////////////////////////////////////////////////
-
-domain kinematic_drones_dis{
-
-types {
-    aircraft : object;
-};
-
-pvariables {
-
-    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
-    GRAVITY : { non-fluent, real, default = 9.8};
-
-    // 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};
-
-    SCALE_FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
-    VEL_REG     : {non-fluent, real, default = 0.001};            // regularizatino factor when dividing by zero velocity
-
-    // bounds on actions
-    MIN_ACC(aircraft) : {non-fluent, int, default = -1};
-    MAX_ACC(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};
-
-    // States
-    // Cartesian Coordinates
-    pos_x(aircraft) : { state-fluent, real, default = 0.0 }; // X axis coordinate
-    pos_y(aircraft) : { state-fluent, real, default = 0.0 }; // Y axis coordinate
-    pos_z(aircraft) : { state-fluent, real, default = 0.0 }; // Z axis coordinate
-    // Angles
-    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
-    // velocity
-    vel(aircraft) : { state-fluent, real, default = 1.0 }; // velocity in the direction of the nose
-
-    // actions
-    set_acc(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_acc(?a), MAX_ACC(?a)], MIN_ACC(?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)+VEL_REG)) * GRAVITY;
-
-};
-
-reward = -sum_{?a : aircraft} [CONTROLLABLE(?a) * [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]]] ];
-
-//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]]) ];
-
-state-invariants {
-    // boundaries of the aircraft 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 ];
-    };
-
-action-preconditions {
-    // boundaries for set acc
-    forall_{?a : aircraft}[ set_acc(?a) <= MAX_ACC(?a)];
-    forall_{?a : aircraft}[ set_acc(?a) >= MIN_ACC(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) <= MAX_PHI(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) >= MIN_PHI(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) <= MAX_THETA(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) >= MIN_THETA(?a)];
-};
-
-}
\ No newline at end of file
diff --git a/Competition/Drone_dis/instance0.rddl b/Competition/Drone_dis/instance0.rddl
deleted file mode 100644
index 841a14e9..00000000
--- a/Competition/Drone_dis/instance0.rddl
+++ /dev/null
@@ -1,52 +0,0 @@
-non-fluents nf_simple_drone_p0{
-	domain = kinematic_drones_dis;
-
-	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 = kinematic_drones_dis;
-	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
deleted file mode 100644
index e143599a..00000000
--- a/Competition/Drone_mix/domain.rddl
+++ /dev/null
@@ -1,118 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-//
-// Drone RDDL domain
-//
-///////////////////////////////////////////////////////////////////////////////
-
-domain kinematic_drones_mix{
-
-types {
-    aircraft : object;
-
-};
-
-pvariables {
-
-    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
-    GRAVITY : { non-fluent, real, default = 9.8};
-
-    // 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};
-
-    SCALE_FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
-    RANDOM_WALK_COEFF : {non-fluent, real, default = 0.1 };       // variance constant for random walk of non controllable drones
-    VEL_REG     : {non-fluent, real, default = 0.001};            // regularizatino factor when dividing by zero velocity
-
-    // bounds for Rates
-    MIN_ACC(aircraft) : {non-fluent, int, default = -1};
-    MAX_ACC(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};
-    
-    // States
-    // Cartesian Coordinates
-    pos_x(aircraft) : { state-fluent, real, default = 0.0 }; // X axis coordinate
-    pos_y(aircraft) : { state-fluent, real, default = 0.0 }; // Y axis coordinate
-    pos_z(aircraft) : { state-fluent, real, default = 0.0 }; // Z axis coordinate
-    // Angles
-    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
-    // velocity
-    vel(aircraft) : { state-fluent, real, default = 1.0 }; // velocity in the direction of the nose
-
-    // actions
-    set_acc(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) = if (CONTROLLABLE(?a))
-                 then pos_x(?a) + SCALE_FACTOR * vel(?a) * cos[psi(?a)]
-                 else pos_x(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    pos_y'(?a) = if (CONTROLLABLE(?a))
-                 then pos_y(?a) + SCALE_FACTOR * vel(?a) * sin[psi(?a)]
-                 else pos_y(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    pos_z'(?a) = if (CONTROLLABLE(?a))
-                 then pos_z(?a) + SCALE_FACTOR * vel(?a) * sin[theta(?a)]
-                 else pos_z(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    
-    // velocity
-    vel'(?a) = if (CONTROLLABLE(?a))
-               then max[0, vel(?a) + SCALE_FACTOR * max[min[set_acc(?a), MAX_ACC(?a)], MIN_ACC(?a)]]
-               else max[0, vel(?a) + Normal(0.0, RANDOM_WALK_COEFF)];
-
-    // angle changes
-    phi'(?a) = if (CONTROLLABLE(?a))
-               then phi(?a) + SCALE_FACTOR * max[min[set_phi(?a), MAX_PHI(?a)], MIN_PHI(?a)]
-               else phi(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    theta'(?a) = if (CONTROLLABLE(?a))
-                 then theta(?a) + SCALE_FACTOR * max[min[set_theta(?a), MAX_THETA(?a)], MIN_THETA(?a)]
-                 else theta(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-    psi'(?a) = if (CONTROLLABLE(?a))
-               then psi(?a) + SCALE_FACTOR * (tan[phi(?a)] / (vel(?a)+VEL_REG)) * GRAVITY
-               else psi(?a) + Normal(0.0, RANDOM_WALK_COEFF);
-
-};
-
-reward = -sum_{?a : aircraft} [CONTROLLABLE(?a) * [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]]] ];
-
-state-invariants {
-    // boundaries of the aircraft locations
-    forall_{?a : aircraft}[ pos_x(?a) <= MAX_X ];
-    forall_{?a : aircraft}[ pos_x(?a) >= MIN_X ];
-    forall_{?a : aircraft}[ pos_y(?a) <= MAX_Y ];
-    forall_{?a : aircraft}[ pos_y(?a) >= MIN_Y ];
-    forall_{?a : aircraft}[ pos_z(?a) <= MAX_Z ];
-    forall_{?a : aircraft}[ pos_z(?a) >= MIN_Z ];
-};
-
-action-preconditions {
-    // boundaries for set acc
-    forall_{?a : aircraft}[ set_acc(?a) <= MAX_ACC(?a)];
-    forall_{?a : aircraft}[ set_acc(?a) >= MIN_ACC(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) <= MAX_PHI(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) >= MIN_PHI(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) <= MAX_THETA(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) >= MIN_THETA(?a)];
-};
-
-}
\ No newline at end of file
diff --git a/Competition/Drone_mix/domain_old.rddl b/Competition/Drone_mix/domain_old.rddl
deleted file mode 100644
index 9f20dd80..00000000
--- a/Competition/Drone_mix/domain_old.rddl
+++ /dev/null
@@ -1,104 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-//
-// Drone RDDL domain
-//
-///////////////////////////////////////////////////////////////////////////////
-
-domain kinematic_drones_mix{
-
-types {
-    aircraft : object;
-
-};
-
-pvariables {
-
-    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
-    GRAVITY : { non-fluent, real, default = 9.8};
-
-    // 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};
-
-    SCALE_FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
-    VEL_REG     : {non-fluent, real, default = 0.001};            // regularizatino factor when dividing by zero velocity
-
-    // bounds for Rates
-    MIN_ACC(aircraft) : {non-fluent, int, default = -1};
-    MAX_ACC(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};
-    
-    // States
-    // Cartesian Coordinates
-    pos_x(aircraft) : { state-fluent, real, default = 0.0 }; // X axis coordinate
-    pos_y(aircraft) : { state-fluent, real, default = 0.0 }; // Y axis coordinate
-    pos_z(aircraft) : { state-fluent, real, default = 0.0 }; // Z axis coordinate
-    // Angles
-    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
-    // velocity
-    vel(aircraft) : { state-fluent, real, default = 1.0 }; // velocity in the direction of the nose
-
-    // actions
-    set_acc(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_acc(?a), MAX_ACC(?a)], MIN_ACC(?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)+VEL_REG)) * GRAVITY;
-
-};
-
-reward = -sum_{?a : aircraft} [CONTROLLABLE(?a) * [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]]] ];
-
-//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]]) ];
-
-state-invariants {
-    // boundaries of the aircraft 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 ];
-    };
-
-action-preconditions {
-    // boundaries for set acc
-    forall_{?a : aircraft}[ set_acc(?a) <= MAX_ACC(?a)];
-    forall_{?a : aircraft}[ set_acc(?a) >= MIN_ACC(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) <= MAX_PHI(?a)];
-    forall_{?a : aircraft}[ set_phi(?a) >= MIN_PHI(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) <= MAX_THETA(?a)];
-    forall_{?a : aircraft}[ set_theta(?a) >= MIN_THETA(?a)];
-};
-
-}
\ No newline at end of file
diff --git a/Competition/Drone_mix/instance0.rddl b/Competition/Drone_mix/instance0.rddl
deleted file mode 100644
index 6f633604..00000000
--- a/Competition/Drone_mix/instance0.rddl
+++ /dev/null
@@ -1,52 +0,0 @@
-non-fluents nf_simple_drone_p0{
-	domain = kinematic_drones_mix;
-
-	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 = kinematic_drones_mix;
-	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/Mars_rover/domain.rddl b/Competition/Mars_rover/domain.rddl
index 67e02b10..f6944aff 100644
--- a/Competition/Mars_rover/domain.rddl
+++ b/Competition/Mars_rover/domain.rddl
@@ -5,9 +5,9 @@
 // designated radii) as possible within the time constraints.
 //
 // The movement model is of a second order integrator in 2d
-// The states for each drone is the x,y positions and velocities.
+// The states for each rover is the x,y positions and velocities.
 // The actions are acceleartion in the x,y axes.
-// A third action for each drone is minearl harvesting when possible.
+// A third action for each rover is minearl harvesting when possible.
 //
 ////////////////////////////////////////////////////////////////////
 domain mars_rover_science_mission {
@@ -17,79 +17,79 @@ domain mars_rover_science_mission {
     };
 
     types {
-		drone : object;
+		rover : object;
 		mineral : object;
 	}; 
 
     pvariables {
 
-        // drone constants
-        MAX_POWER(drone): { non-fluent, real, default = 0.05 };         // control norm constraint
-        SCALE_FACTOR    : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
+        // rover constants
+        MAX-POWER(rover): { non-fluent, real, default = 0.05 };         // control norm constraint
+        SCALE-FACTOR    : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
 
         // minerals constants
-        MINERAL_AREA(mineral) : { non-fluent, real, default = 1 };            // mineral harvesting area
-        MINERAL_VALUE(mineral): { non-fluent, real, default = 1 };            // mineral harvesting value
-        MINERAL_POS_X(mineral): { non-fluent, real, default = 0 };            // mineral x location
-        MINERAL_POS_Y(mineral): { non-fluent, real, default = 0 };            // mineral y location
+        MINERAL-AREA(mineral) : { non-fluent, real, default = 1 };            // mineral harvesting area
+        MINERAL-VALUE(mineral): { non-fluent, real, default = 1 };            // mineral harvesting value
+        MINERAL-POS-X(mineral): { non-fluent, real, default = 0 };            // mineral x location
+        MINERAL-POS-Y(mineral): { non-fluent, real, default = 0 };            // mineral y location
 
         // interm & derived fluents
-        power(drone) : { derived-fluent, real };                          // derived fluent for control input norm calculation
-        u_x(drone) : { derived-fluent, real };                          // derived fluent for norm saturated x control
-        u_y(drone) : { derived-fluent, real };                          // derived fluent for norm saturated y control
+        power(rover) : { derived-fluent, real };                          // derived fluent for control input norm calculation
+        u-x(rover) : { derived-fluent, real };                          // derived fluent for norm saturated x control
+        u-y(rover) : { derived-fluent, real };                          // derived fluent for norm saturated y control
 
         // states
-        vel_x(drone)    : { state-fluent, real, default = 0 };          // drone x direction velocity
-        pos_x(drone)    : { state-fluent, real, default = 0 };          // drone x position
-        vel_y(drone)    : { state-fluent, real, default = 0 };          // drone y velocity
-        pos_y(drone)    : { state-fluent, real, default = 0 };          // drone y position
-        mineral_harvested(mineral) : { state-fluent, bool, default = false }; // if a mineral has been mineral mineral harvested or not
+        vel-x(rover)    : { state-fluent, real, default = 0 };          // rover x direction velocity
+        pos-x(rover)    : { state-fluent, real, default = 0 };          // rover x position
+        vel-y(rover)    : { state-fluent, real, default = 0 };          // rover y velocity
+        pos-y(rover)    : { state-fluent, real, default = 0 };          // rover y position
+        mineral-harvested(mineral) : { state-fluent, bool, default = false }; // if a mineral has been mineral mineral harvested or not
 
         // actions
-        power_x(drone)      : { action-fluent, real, default = 0 };     // force input in x direction
-        power_y(drone)      : { action-fluent, real, default = 0 };     // force input in y direction
-        harvest(drone)      : { action-fluent, bool, default = false }; // mineral harvesting action
+        power-x(rover)      : { action-fluent, real, default = 0 };     // force input in x direction
+        power-y(rover)      : { action-fluent, real, default = 0 };     // force input in y direction
+        harvest(rover)      : { action-fluent, bool, default = false }; // mineral harvesting action
     };
 
     cpfs {
 
-        power(?d) = sqrt[ pow[power_x(?d), 2] + pow[power_y(?d), 2]];
+        power(?d) = sqrt[ pow[power-x(?d), 2] + pow[power-y(?d), 2]];
 
-        u_x(?d) = if(power(?d) >= MAX_POWER(?d))
-                    then MAX_POWER(?d) * power_x(?d) / power(?d)
-                    else power_x(?d);
-        u_y(?d) = if(power(?d) >= MAX_POWER(?d))
-                	then MAX_POWER(?d) * power_y(?d) / power(?d)
-                	else power_y(?d);
+        u-x(?d) = if(power(?d) >= MAX-POWER(?d))
+                    then MAX-POWER(?d) * power-x(?d) / power(?d)
+                    else power-x(?d);
+        u-y(?d) = if(power(?d) >= MAX-POWER(?d))
+                	then MAX-POWER(?d) * power-y(?d) / power(?d)
+                	else power-y(?d);
 
-        vel_x'(?d) = vel_x(?d) + SCALE_FACTOR * u_x(?d);
-        vel_y'(?d) = vel_y(?d) + SCALE_FACTOR * u_y(?d);
-        pos_x'(?d) = pos_x(?d) + SCALE_FACTOR * vel_x(?d);
-        pos_y'(?d) = pos_y(?d) + SCALE_FACTOR * vel_y(?d);
+        vel-x'(?d) = vel-x(?d) + SCALE-FACTOR * u-x(?d);
+        vel-y'(?d) = vel-y(?d) + SCALE-FACTOR * u-y(?d);
+        pos-x'(?d) = pos-x(?d) + SCALE-FACTOR * vel-x(?d);
+        pos-y'(?d) = pos-y(?d) + SCALE-FACTOR * vel-y(?d);
 
-        mineral_harvested'(?m) = mineral_harvested(?m) |
-                ~mineral_harvested(?m) ^ [exists_{?d : drone}
-                    [sqrt [ pow[pos_x(?d)-MINERAL_POS_X(?m),2] + pow[pos_y(?d)-MINERAL_POS_Y(?m),2]] < MINERAL_AREA(?m) ^ harvest(?d)]];
+        mineral-harvested'(?m) = mineral-harvested(?m) |
+                ~mineral-harvested(?m) ^ [exists_{?d : rover}
+                    [sqrt [ pow[pos-x(?d) - MINERAL-POS-X(?m),2] + pow[pos-y(?d) - MINERAL-POS-Y(?m),2]] < MINERAL-AREA(?m) ^ harvest(?d)]];
 
     };
 
-    // R = -sum u_x^2 + u_y^2 + sum minerals harvested - sum harvest actions
-    reward = [-sum_{?d : drone} [ pow[u_x(?d), 2] + pow[u_y(?d), 2]]] +
-             [sum_{?m : mineral }[if (exists_{?d : drone}
-                        [(sqrt[pow[pos_x(?d)-MINERAL_POS_X(?m),2] + pow[pos_y(?d)-MINERAL_POS_Y(?m),2]] < MINERAL_AREA(?m)) ^ harvest(?d)])
-                            then MINERAL_VALUE(?m)
+    // R = -sum u-x^2 + u-y^2 + sum minerals harvested - sum harvest actions
+    reward = [-sum_{?d : rover} [ pow[u-x(?d), 2] + pow[u-y(?d), 2]]] +
+             [sum_{?m : mineral }[if (exists_{?d : rover}
+                        [(sqrt[pow[pos-x(?d) - MINERAL-POS-X(?m),2] + pow[pos-y(?d) - MINERAL-POS-Y(?m),2]] < MINERAL-AREA(?m)) ^ harvest(?d)])
+                            then MINERAL-VALUE(?m)
                             else 0.0]]
-             - [sum_{?d : drone} [harvest(?d)]];
+             - [sum_{?d : rover} [harvest(?d)]];
 
     state-invariants {
-        forall_{?m : mineral} [MINERAL_AREA(?m) > 0 ];
+        forall_{?m : mineral} [MINERAL-AREA(?m) > 0 ];
     };
 
     action-preconditions {
-        forall_{?d : drone} [ power_x(?d) >= -MAX_POWER(?d) ];
-        forall_{?d : drone} [ power_x(?d) <= MAX_POWER(?d) ];
-        forall_{?d : drone} [ power_y(?d) >= -MAX_POWER(?d) ];
-        forall_{?d : drone} [ power_y(?d) <= MAX_POWER(?d) ];
+        forall_{?d : rover} [ power-x(?d) >= -MAX-POWER(?d) ];
+        forall_{?d : rover} [ power-x(?d) <= MAX-POWER(?d) ];
+        forall_{?d : rover} [ power-y(?d) >= -MAX-POWER(?d) ];
+        forall_{?d : rover} [ power-y(?d) <= MAX-POWER(?d) ];
     };
 
 }
diff --git a/Competition/Mars_rover/instance0.rddl b/Competition/Mars_rover/instance0.rddl
index 9831286a..19b628f2 100644
--- a/Competition/Mars_rover/instance0.rddl
+++ b/Competition/Mars_rover/instance0.rddl
@@ -5,9 +5,9 @@
 // designated radii) as possible within the time constraints.
 //
 // The movement model is of a second order integrator in 2d
-// The states for each drone is the x,y positions and velocities.
+// The states for each rover is the x,y positions and velocities.
 // The actions are acceleartion in the x,y axes.
-// A third action for each drone is minearl harvesting when possible.
+// A third action for each rover is minearl harvesting when possible.
 //
 ////////////////////////////////////////////////////////////////////
 
@@ -15,19 +15,19 @@ non-fluents rover2 {
     domain = mars_rover_science_mission;
 
     objects {
-		drone : { d1, d2 };
+		rover : { d1, d2 };
 		mineral : { m1, m2 };
 	};
 
 	non-fluents {
-        MINERAL_POS_X(m1) = 5;
-		MINERAL_POS_Y(m1) = 5;
-		MINERAL_VALUE(m1) = 8;
-		MINERAL_AREA(m1) = 6;
-		MINERAL_POS_X(m2) = -8;
-		MINERAL_POS_Y(m2) = -8;
-		MINERAL_VALUE(m2) = 5;
-		MINERAL_AREA(m2) = 8;
+        MINERAL-POS_X(m1) = 5;
+		MINERAL-POS_Y(m1) = 5;
+		MINERAL-VALUE(m1) = 8;
+		MINERAL-AREA(m1) = 6;
+		MINERAL-POS_X(m2) = -8;
+		MINERAL-POS_Y(m2) = -8;
+		MINERAL-VALUE(m2) = 5;
+		MINERAL-AREA(m2) = 8;
 	};
 
 }
@@ -40,15 +40,15 @@ instance inst_mars_rover {
 	non-fluents = rover2;
 
 	init-state {
-		vel_x(d1) = 1;
-        vel_y(d1) = 1;
-        pos_x(d1) = 0;
-        pos_y(d1) = 0;
-
-		vel_x(d2) = 2;
-        vel_y(d2) = 2;
-        pos_x(d2) = 3;
-        pos_y(d2) = 3;
+		vel-x(d1) = 1;
+        vel-y(d1) = 1;
+        pos-x(d1) = 0;
+        pos-y(d1) = 0;
+
+		vel-x(d2) = 2;
+        vel-y(d2) = 2;
+        pos-x(d2) = 3;
+        pos-y(d2) = 3;
 	};
 
   	// State-action constraints above are sufficient
diff --git a/Competition/MountainCar/domain.rddl b/Competition/MountainCar/domain.rddl
index 6059f4e9..b634e1d9 100644
--- a/Competition/MountainCar/domain.rddl
+++ b/Competition/MountainCar/domain.rddl
@@ -13,17 +13,17 @@ domain mountain_car {
     pvariables {
 
     	// physics constants
-		GRAVITY_MAG : { non-fluent, real, default = 0.0025 };       // force of gravity acting down
-		FORCE_MAG 	: { non-fluent, real, default = 0.001 };		// force applied to the side of the cart
+		GRAVITY-MAG : { non-fluent, real, default = 0.0025 };       // force of gravity acting down
+		FORCE-MAG 	: { non-fluent, real, default = 0.001 };		// force applied to the side of the cart
 
 		// valley shape
 		DEPTH : { non-fluent, real, default = 0.45 };				// depth of the valley
 		
 		// bounds
-		MIN_POS : { non-fluent, real, default = -1.2 };        		// min position of cart
-		MAX_POS : { non-fluent, real, default = 0.6 };			 	// max position of cart
-		MAX_VEL : { non-fluent, real, default = 0.07 };				// max velocity of cart
-		GOAL_MIN : { non-fluent, real, default = 0.5 };				// desired x position of cart
+		MIN-POS : { non-fluent, real, default = -1.2 };        		// min position of cart
+		MAX-POS : { non-fluent, real, default = 0.6 };			 	// max position of cart
+		MAX-VEL : { non-fluent, real, default = 0.07 };				// max velocity of cart
+		GOAL-MIN : { non-fluent, real, default = 0.5 };				// desired x position of cart
 		
 		// interm & derived fluents
 		success : { derived-fluent, bool };                       	// whether the cart reached its goal
@@ -38,14 +38,14 @@ domain mountain_car {
 
     cpfs {
 		// check if we reached the goal
-		success = (pos >= GOAL_MIN) ^ (vel >= 0); 
+		success = (pos >= GOAL-MIN) ^ (vel >= 0);
 		
 		// update position and velocity of the cart
 		vel' = if(success)
 				then 0.0
-				else [max[min[vel + (action - 1) * FORCE_MAG + cos[3 * pos] * (-GRAVITY_MAG) * (3 * DEPTH), 
-						MAX_VEL], -MAX_VEL]];
-		pos' = max[min[pos + vel', MAX_POS], MIN_POS];		
+				else [max[min[vel + (action - 1) * FORCE-MAG + cos[3 * pos] * (-GRAVITY-MAG) * (3 * DEPTH),
+						MAX-VEL], -MAX-VEL]];
+		pos' = max[min[pos + vel', MAX-POS], MIN-POS];
     };
 
     // R = 1 as long as the pole is upright and the cart is not out of bounds
@@ -54,8 +54,8 @@ domain mountain_car {
 				else 0.0;
 
     state-invariants {
-		pos >= MIN_POS ^ pos <= MAX_POS;
-		vel >= -MAX_VEL ^ vel <= MAX_VEL;
+		pos >= MIN-POS ^ pos <= MAX-POS;
+		vel >= -MAX-VEL ^ vel <= MAX-VEL;
     };
 
     action-preconditions {
diff --git a/Competition/Power_gen/domain.rddl b/Competition/Power_gen/domain.rddl
index 81dee9b0..bf1162c8 100644
--- a/Competition/Power_gen/domain.rddl
+++ b/Competition/Power_gen/domain.rddl
@@ -34,17 +34,16 @@ domain power_gen {
 	pvariables { 
     	
 		// Constants
-		PROD_UNITS_MIN(plant)      : { non-fluent, int,  default = 3   };
-		PROD_UNITS_MAX(plant)      : { non-fluent, int,  default = 10  };
-		PROD_CHANGE_PENALTY(plant) : { non-fluent, real, default = 1.0 };
-		COST_PER_UNIT(plant)       : { non-fluent, real, default = 5.0 };
-		INCOME_PER_UNIT            : { non-fluent, real, default = 8.0 };
-		TEMP_VARIANCE              : { non-fluent, real, default = 5.0 };
-		OBS_VARIANCE               : { non-fluent, real, default = 5.0 };
-		DEMAND_EXP_COEF            : { non-fluent, real, default = 0.01 };
-		MIN_DEMAND_TEMP            : { non-fluent, real, default = 11.7 };
-		MIN_CONSUMPTION            : { non-fluent, real, default = 2 };
-		UNFULFILLED_DEMAND_PENALTY : { non-fluent, real, default = 1000.0 };
+		PROD-UNITS-MIN(plant)      : { non-fluent, int,  default = 3   };
+		PROD-UNITS-MAX(plant)      : { non-fluent, int,  default = 10  };
+		PROD-CHANGE-PENALTY(plant) : { non-fluent, real, default = 1.0 };
+		COST-PER-UNIT(plant)       : { non-fluent, real, default = 5.0 };
+		INCOME-PER-UNIT            : { non-fluent, real, default = 8.0 };
+		TEMP-VARIANCE              : { non-fluent, real, default = 5.0 };
+		DEMAND-EXP-COEF            : { non-fluent, real, default = 0.01 };
+		MIN-DEMAND-TEMP            : { non-fluent, real, default = 11.7 };
+		MIN-CONSUMPTION            : { non-fluent, real, default = 2 };
+		UNFULFILLED-DEMAND-PENALTY : { non-fluent, real, default = 1000.0 };
 
     	// Action - int
 		curProd(plant) : { action-fluent, int, default = 0 };
@@ -63,28 +62,28 @@ domain power_gen {
 	cpfs {
 
 		// State
-		prod(?p) = max[min[curProd(?p), PROD_UNITS_MAX(?p)], PROD_UNITS_MIN(?p)];
+		prod(?p) = max[min[curProd(?p), PROD-UNITS-MAX(?p)], PROD-UNITS-MIN(?p)];
 		prevProd'(?p) = prod(?p);
-		temperature'  = Normal(temperature, TEMP_VARIANCE);
+		temperature'  = Normal(temperature, TEMP-VARIANCE);
 		
 		// Demand -- a function of the current temperature,
 		//           empirically a U-shaped function with a minimum
 		//           at 11.7 C, here we use a simple quadratic model.
-		demand = MIN_CONSUMPTION + DEMAND_EXP_COEF * pow[ temperature - MIN_DEMAND_TEMP , 2 ];
+		demand = MIN-CONSUMPTION + DEMAND-EXP-COEF * pow[ temperature - MIN-DEMAND-TEMP , 2 ];
 		fulfilledDemand = min[ demand, (sum_{?p : plant} prod(?p)) ];
 
 	};
   
 	// cost of supply per plant, demand income, demand exceeds supply penalty, steady-state penalties
-	reward = [-(sum_{?p : plant} prod(?p) * COST_PER_UNIT(?p))]
-		     + (fulfilledDemand * INCOME_PER_UNIT)
-		     - (if (demand > fulfilledDemand) then UNFULFILLED_DEMAND_PENALTY else 0.0 )
-		     + (sum_{?p : plant} abs[ prod(?p) - prevProd(?p) ] * PROD_CHANGE_PENALTY(?p) );
+	reward = [-(sum_{?p : plant} prod(?p) * COST-PER-UNIT(?p))]
+		     + (fulfilledDemand * INCOME-PER-UNIT)
+		     - (if (demand > fulfilledDemand) then UNFULFILLED-DEMAND-PENALTY else 0.0 )
+		     + (sum_{?p : plant} abs[ prod(?p) - prevProd(?p) ] * PROD-CHANGE-PENALTY(?p) );
 	
 	action-preconditions {
 
 		// Production amounts within bounds 
-		forall_{?p : plant} [ curProd(?p) >= PROD_UNITS_MIN(?p) ];
-		forall_{?p : plant} [ curProd(?p) <= PROD_UNITS_MAX(?p) ];
+		forall_{?p : plant} [ curProd(?p) >= PROD-UNITS-MIN(?p) ];
+		forall_{?p : plant} [ curProd(?p) <= PROD-UNITS-MAX(?p) ];
 	};
 }
diff --git a/Competition/UAVs_con/domain.rddl b/Competition/UAVs_con/domain.rddl
new file mode 100644
index 00000000..3e8d85db
--- /dev/null
+++ b/Competition/UAVs_con/domain.rddl
@@ -0,0 +1,118 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// UAVs RDDL domain
+//
+///////////////////////////////////////////////////////////////////////////////
+
+domain kinematic_UAVs_con{
+
+types {
+    aircraft : object;
+};
+
+pvariables {
+
+    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
+    GRAVITY : { non-fluent, real, default = 9.8};
+
+    // 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};
+
+    SCALE-FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
+    RANDOM-WALK-COEFF : {non-fluent, real, default = 0.1 };       // variance constant for random walk of non controllable UAVs
+    VEL-REG     : {non-fluent, real, default = 0.001};            // regularizatino factor when dividing by zero velocity
+
+    // bounds on actions
+    MIN-ACC(aircraft) : {non-fluent, real, default = -1.0};
+    MAX-ACC(aircraft) : {non-fluent, real, default = 1.0};
+    MIN-DELTA-PHI(aircraft) : {non-fluent, real, default = -1.0};
+    MAX-DELTA-PHI(aircraft) : {non-fluent, real, default = 1.0};
+    MIN-DELTA-THETA(aircraft) : {non-fluent, real, default = -1.0};
+    MAX-DELTA-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};
+
+    // States
+    // Cartesian Coordinates
+    pos-x(aircraft) : { state-fluent, real, default = 0.0 }; // X axis coordinate
+    pos-y(aircraft) : { state-fluent, real, default = 0.0 }; // Y axis coordinate
+    pos-z(aircraft) : { state-fluent, real, default = 0.0 }; // Z axis coordinate
+    // Angles
+    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
+    // velocity
+    vel(aircraft) : { state-fluent, real, default = 1.0 }; // velocity in the direction of the nose
+
+    // actions
+    set-acc(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) = if (CONTROLLABLE(?a))
+                 then pos-x(?a) + SCALE-FACTOR * vel(?a) * cos[psi(?a)]
+                 else pos-x(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    pos-y'(?a) = if (CONTROLLABLE(?a))
+                 then pos-y(?a) + SCALE-FACTOR * vel(?a) * sin[psi(?a)]
+                 else pos-y(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    pos-z'(?a) = if (CONTROLLABLE(?a))
+                 then pos-z(?a) + SCALE-FACTOR * vel(?a) * sin[theta(?a)]
+                 else pos-z(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+
+    // velocity
+    vel'(?a) = if (CONTROLLABLE(?a))
+               then max[0, vel(?a) + SCALE-FACTOR * max[min[set-acc(?a), MAX-ACC(?a)], MIN-ACC(?a)]]
+               else max[0, vel(?a) + Normal(0.0, RANDOM-WALK-COEFF)];
+
+    // angle changes
+    phi'(?a) = if (CONTROLLABLE(?a))
+               then phi(?a) + SCALE-FACTOR * max[min[set-phi(?a), MAX-DELTA-PHI(?a)], MIN-DELTA-PHI(?a)]
+               else phi(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    theta'(?a) = if (CONTROLLABLE(?a))
+                 then theta(?a) + SCALE-FACTOR * max[min[set-theta(?a), MAX-DELTA-THETA(?a)], MIN-DELTA-THETA(?a)]
+                 else theta(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    psi'(?a) = if (CONTROLLABLE(?a))
+               then psi(?a) + SCALE-FACTOR * (tan[phi(?a)] / (vel(?a)+VEL-REG)) * GRAVITY
+               else psi(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+
+};
+
+reward = -sum_{?a : aircraft} [CONTROLLABLE(?a) * [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]]] ];
+
+
+state-invariants {
+    // boundaries of the aircraft locations
+    forall_{?a : aircraft}[ pos-x(?a) <= MAX-X ];
+    forall_{?a : aircraft}[ pos-x(?a) >= MIN-X ];
+    forall_{?a : aircraft}[ pos-y(?a) <= MAX-Y ];
+    forall_{?a : aircraft}[ pos-y(?a) >= MIN-Y ];
+    forall_{?a : aircraft}[ pos-z(?a) <= MAX-Z ];
+    forall_{?a : aircraft}[ pos-z(?a) >= MIN-Z ];
+};
+
+action-preconditions {
+    // boundaries for set acc
+    forall_{?a : aircraft}[ set-acc(?a) <= MAX-ACC(?a)];
+    forall_{?a : aircraft}[ set-acc(?a) >= MIN-ACC(?a)];
+    forall_{?a : aircraft}[ set-phi(?a) <= MAX-DELTA-PHI(?a)];
+    forall_{?a : aircraft}[ set-phi(?a) >= MIN-DELTA-PHI(?a)];
+    forall_{?a : aircraft}[ set-theta(?a) <= MAX-DELTA-THETA(?a)];
+    forall_{?a : aircraft}[ set-theta(?a) >= MIN-DELTA-THETA(?a)];
+};
+
+}
\ No newline at end of file
diff --git a/Competition/UAVs_con/instance0.rddl b/Competition/UAVs_con/instance0.rddl
new file mode 100644
index 00000000..006670f3
--- /dev/null
+++ b/Competition/UAVs_con/instance0.rddl
@@ -0,0 +1,57 @@
+non-fluents nf_simple_UAV_p0{
+	domain = kinematic_UAVs_con;
+
+	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-DELTA-PHI(a1) = -1.0;
+        MAX-DELTA-PHI(a1) = 1.0;
+        MIN-DELTA-THETA(a1) = -1.0;
+        MAX-DELTA-THETA(a1) = 1.0;
+
+        GOAL-X(a1) = 50.0;
+        GOAL-Y(a1) = 50.0;
+        GOAL-z(a1) = 50.0;
+
+        CONTROLLABLE(a1);
+	};
+}
+
+instance simple_UAV_p0 {
+	domain = kinematic_UAVs_con;
+	non-fluents = nf_simple_UAV_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/UAVs_con/instance1.rddl b/Competition/UAVs_con/instance1.rddl
new file mode 100644
index 00000000..7707df39
--- /dev/null
+++ b/Competition/UAVs_con/instance1.rddl
@@ -0,0 +1,60 @@
+non-fluents nf_simple_UAV_p0{
+	domain = kinematic_UAVs_con;
+
+	objects {
+		aircraft : {a1, a2, a3};
+	};
+
+	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-DELTA-PHI(a1) = -1.0;
+        MAX-DELTA-PHI(a1) = 1.0;
+        MIN-DELTA-THETA(a1) = -1.0;
+        MAX-DELTA-THETA(a1) = 1.0;
+
+        GOAL-X(a1) = 50.0;
+        GOAL-Y(a1) = 50.0;
+        GOAL-Z(a1) = 50.0;
+
+        CONTROLLABLE(a1);
+	};
+}
+
+instance simple_UAV_p0 {
+	domain = kinematic_UAVs_con;
+	non-fluents = nf_simple_UAV_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/UAVs_dis/domain.rddl b/Competition/UAVs_dis/domain.rddl
new file mode 100644
index 00000000..9870189b
--- /dev/null
+++ b/Competition/UAVs_dis/domain.rddl
@@ -0,0 +1,117 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// UAVs RDDL domain
+//
+///////////////////////////////////////////////////////////////////////////////
+
+domain kinematic_UAVs_dis{
+
+types {
+    aircraft : object;
+};
+
+pvariables {
+
+    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
+    GRAVITY : { non-fluent, real, default = 9.8};
+
+    // 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};
+
+    SCALE-FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
+    RANDOM-WALK-COEFF : {non-fluent, real, default = 0.1 };       // variance constant for random walk of non controllable UAVs
+    VEL-REG     : {non-fluent, real, default = 0.001};            // regularizatino factor when dividing by zero velocity
+
+    // bounds on actions
+    MIN-ACC(aircraft) : {non-fluent, int, default = -1};
+    MAX-ACC(aircraft) : {non-fluent, int, default = 1};
+    MIN-DELTA-PHI(aircraft) : {non-fluent, int, default = -1};
+    MAX-PHI(aircraft) : {non-fluent, int, default = 1};
+    MIN-DELTA-THETA(aircraft) : {non-fluent, int, default = -1};
+    MAX-DELTA-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};
+
+    // States
+    // Cartesian Coordinates
+    pos-x(aircraft) : { state-fluent, real, default = 0.0 }; // X axis coordinate
+    pos-y(aircraft) : { state-fluent, real, default = 0.0 }; // Y axis coordinate
+    pos-z(aircraft) : { state-fluent, real, default = 0.0 }; // Z axis coordinate
+    // Angles
+    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
+    // velocity
+    vel(aircraft) : { state-fluent, real, default = 1.0 }; // velocity in the direction of the nose
+
+    // actions
+    set-acc(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) = if (CONTROLLABLE(?a))
+                 then pos-x(?a) + SCALE-FACTOR * vel(?a) * cos[psi(?a)]
+                 else pos-x(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    pos-y'(?a) = if (CONTROLLABLE(?a))
+                 then pos-y(?a) + SCALE-FACTOR * vel(?a) * sin[psi(?a)]
+                 else pos-y(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    pos-z'(?a) = if (CONTROLLABLE(?a))
+                 then pos-z(?a) + SCALE-FACTOR * vel(?a) * sin[theta(?a)]
+                 else pos-z(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+
+    // velocity
+    vel'(?a) = if (CONTROLLABLE(?a))
+               then max[0, vel(?a) + SCALE-FACTOR * max[min[set-acc(?a), MAX-ACC(?a)], MIN-ACC(?a)]]
+               else max[0, vel(?a) + Normal(0.0, RANDOM-WALK-COEFF)];
+
+    // angle changes
+    phi'(?a) = if (CONTROLLABLE(?a))
+               then phi(?a) + SCALE-FACTOR * max[min[set-phi(?a), MAX-PHI(?a)], MIN-DELTA-PHI(?a)]
+               else phi(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    theta'(?a) = if (CONTROLLABLE(?a))
+                 then theta(?a) + SCALE-FACTOR * max[min[set-theta(?a), MAX-DELTA-THETA(?a)], MIN-DELTA-THETA(?a)]
+                 else theta(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    psi'(?a) = if (CONTROLLABLE(?a))
+               then psi(?a) + SCALE-FACTOR * (tan[phi(?a)] / (vel(?a)+VEL-REG)) * GRAVITY
+               else psi(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+
+};
+
+reward = -sum_{?a : aircraft} [CONTROLLABLE(?a) * [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]]] ];
+
+state-invariants {
+    // boundaries of the aircraft locations
+    forall_{?a : aircraft}[ pos-x(?a) <= MAX-X ];
+    forall_{?a : aircraft}[ pos-x(?a) >= MIN-X ];
+    forall_{?a : aircraft}[ pos-y(?a) <= MAX-Y ];
+    forall_{?a : aircraft}[ pos-y(?a) >= MIN-Y ];
+    forall_{?a : aircraft}[ pos-z(?a) <= MAX-Z ];
+    forall_{?a : aircraft}[ pos-z(?a) >= MIN-Z ];
+};
+
+action-preconditions {
+    // boundaries for set acc
+    forall_{?a : aircraft}[ set-acc(?a) <= MAX-ACC(?a)];
+    forall_{?a : aircraft}[ set-acc(?a) >= MIN-ACC(?a)];
+    forall_{?a : aircraft}[ set-phi(?a) <= MAX-PHI(?a)];
+    forall_{?a : aircraft}[ set-phi(?a) >= MIN-DELTA-PHI(?a)];
+    forall_{?a : aircraft}[ set-theta(?a) <= MAX-DELTA-THETA(?a)];
+    forall_{?a : aircraft}[ set-theta(?a) >= MIN-DELTA-THETA(?a)];
+};
+
+}
\ No newline at end of file
diff --git a/Competition/UAVs_dis/instance0.rddl b/Competition/UAVs_dis/instance0.rddl
new file mode 100644
index 00000000..0da6e78e
--- /dev/null
+++ b/Competition/UAVs_dis/instance0.rddl
@@ -0,0 +1,47 @@
+non-fluents nf_simple_UAV_p0{
+	domain = kinematic_UAVs_dis;
+
+	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_UAV_p0 {
+	domain = kinematic_UAVs_dis;
+	non-fluents = nf_simple_UAV_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/UAVs_mix/domain.rddl b/Competition/UAVs_mix/domain.rddl
new file mode 100644
index 00000000..e0af2eb5
--- /dev/null
+++ b/Competition/UAVs_mix/domain.rddl
@@ -0,0 +1,118 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// UAVs RDDL domain
+//
+///////////////////////////////////////////////////////////////////////////////
+
+domain kinematic_UAVs_mix{
+
+types {
+    aircraft : object;
+
+};
+
+pvariables {
+
+    CONTROLLABLE(aircraft) : { non-fluent, bool, default = false}; // which aircraft can be controlled
+    GRAVITY : { non-fluent, real, default = 9.8};
+
+    // 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};
+
+    SCALE-FACTOR  : { non-fluent, real, default = 0.1 };          // time scale factor for dynamic equations
+    RANDOM-WALK-COEFF : {non-fluent, real, default = 0.1 };       // variance constant for random walk of non controllable UAVs
+    VEL-REG     : {non-fluent, real, default = 0.001};            // regularizatino factor when dividing by zero velocity
+
+    // bounds for Rates
+    MIN-ACC(aircraft) : {non-fluent, int, default = -1};
+    MAX-ACC(aircraft) : {non-fluent, int, default = 1};
+    MIN-DELTA-PHI(aircraft) : {non-fluent, real, default = -1.0};
+    MAX-DELTA-PHI(aircraft) : {non-fluent, real, default = 1.0};
+    MIN-DELTA-THETA(aircraft) : {non-fluent, real, default = -1.0};
+    MAX-DELTA-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};
+    
+    // States
+    // Cartesian Coordinates
+    pos-x(aircraft) : { state-fluent, real, default = 0.0 }; // X axis coordinate
+    pos-y(aircraft) : { state-fluent, real, default = 0.0 }; // Y axis coordinate
+    pos-z(aircraft) : { state-fluent, real, default = 0.0 }; // Z axis coordinate
+    // Angles
+    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
+    // velocity
+    vel(aircraft) : { state-fluent, real, default = 1.0 }; // velocity in the direction of the nose
+
+    // actions
+    set-acc(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) = if (CONTROLLABLE(?a))
+                 then pos-x(?a) + SCALE-FACTOR * vel(?a) * cos[psi(?a)]
+                 else pos-x(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    pos-y'(?a) = if (CONTROLLABLE(?a))
+                 then pos-y(?a) + SCALE-FACTOR * vel(?a) * sin[psi(?a)]
+                 else pos-y(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    pos-z'(?a) = if (CONTROLLABLE(?a))
+                 then pos-z(?a) + SCALE-FACTOR * vel(?a) * sin[theta(?a)]
+                 else pos-z(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    
+    // velocity
+    vel'(?a) = if (CONTROLLABLE(?a))
+               then max[0, vel(?a) + SCALE-FACTOR * max[min[set-acc(?a), MAX-ACC(?a)], MIN-ACC(?a)]]
+               else max[0, vel(?a) + Normal(0.0, RANDOM-WALK-COEFF)];
+
+    // angle changes
+    phi'(?a) = if (CONTROLLABLE(?a))
+               then phi(?a) + SCALE-FACTOR * max[min[set-phi(?a), MAX-DELTA-PHI(?a)], MIN-DELTA-PHI(?a)]
+               else phi(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    theta'(?a) = if (CONTROLLABLE(?a))
+                 then theta(?a) + SCALE-FACTOR * max[min[set-theta(?a), MAX-DELTA-THETA(?a)], MIN-DELTA-THETA(?a)]
+                 else theta(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+    psi'(?a) = if (CONTROLLABLE(?a))
+               then psi(?a) + SCALE-FACTOR * (tan[phi(?a)] / (vel(?a)+VEL-REG)) * GRAVITY
+               else psi(?a) + Normal(0.0, RANDOM-WALK-COEFF);
+
+};
+
+reward = -sum_{?a : aircraft} [CONTROLLABLE(?a) * [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]]] ];
+
+state-invariants {
+    // boundaries of the aircraft locations
+    forall_{?a : aircraft}[ pos-x(?a) <= MAX-X ];
+    forall_{?a : aircraft}[ pos-x(?a) >= MIN-X ];
+    forall_{?a : aircraft}[ pos-y(?a) <= MAX-Y ];
+    forall_{?a : aircraft}[ pos-y(?a) >= MIN-Y ];
+    forall_{?a : aircraft}[ pos-z(?a) <= MAX-Z ];
+    forall_{?a : aircraft}[ pos-z(?a) >= MIN-Z ];
+};
+
+action-preconditions {
+    // boundaries for set acc
+    forall_{?a : aircraft}[ set-acc(?a) <= MAX-ACC(?a)];
+    forall_{?a : aircraft}[ set-acc(?a) >= MIN-ACC(?a)];
+    forall_{?a : aircraft}[ set-phi(?a) <= MAX-DELTA-PHI(?a)];
+    forall_{?a : aircraft}[ set-phi(?a) >= MIN-DELTA-PHI(?a)];
+    forall_{?a : aircraft}[ set-theta(?a) <= MAX-DELTA-THETA(?a)];
+    forall_{?a : aircraft}[ set-theta(?a) >= MIN-DELTA-THETA(?a)];
+};
+
+}
\ No newline at end of file
diff --git a/Competition/UAVs_mix/instance0.rddl b/Competition/UAVs_mix/instance0.rddl
new file mode 100644
index 00000000..144ada02
--- /dev/null
+++ b/Competition/UAVs_mix/instance0.rddl
@@ -0,0 +1,47 @@
+non-fluents nf_simple_UAV_p0{
+	domain = kinematic_UAVs_mix;
+
+	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_UAV_p0 {
+	domain = kinematic_UAVs_mix;
+	non-fluents = nf_simple_UAV_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/Env/RDDLEnv.py b/Env/RDDLEnv.py
index dc3331ce..3b869a53 100644
--- a/Env/RDDLEnv.py
+++ b/Env/RDDLEnv.py
@@ -189,6 +189,11 @@ def render(self):
             pygame.display.flip()
         return image
 
+    def close(self):
+        if self.to_render:
+            pygame.display.quit()
+            pygame.quit()
+
 
     @property
     def NumConcurrentActions(self):
diff --git a/Grounder/RDDLGrounder.py b/Grounder/RDDLGrounder.py
index 1dc4f6da..edf1d88c 100644
--- a/Grounder/RDDLGrounder.py
+++ b/Grounder/RDDLGrounder.py
@@ -19,7 +19,7 @@
     'prod', 'sum', 'avg', 'minimum', 'maximum', 'forall', 'exists'
 ]
 AGGREG_RECURSIVE_OPERATION_INDEX_MAPPED_LIST = [
-    '*', '+', '+', '<', '>', '^', '|'
+    '*', '+', '+', 'min', 'max', '^', '|'
 ]
 AGGREG_OP_TO_STRING_DICT = dict(
     zip(AGGREG_OPERATION_LIST,
@@ -358,54 +358,19 @@ def do_aggregate_expression_nesting(self, original_dict, new_variables_list,
             updated_dict = copy.deepcopy(original_dict)
             updated_dict.update(dict(zip(new_variables_list, instances_list[0])))
             new_expr = self._scan_expr_tree(expression, updated_dict)
-        elif len(instances_list) == 2:  # normal base case
+        else: #we now support multi-arity /arguments for all the aggregate operations, min, max, sum, prod,...
             new_children = []
-            lhs_updated_dict = copy.deepcopy(original_dict)
-            lhs_updated_dict.update(dict(zip(new_variables_list, instances_list[0])))
-            new_children.append(self._scan_expr_tree(expression, lhs_updated_dict))
-            rhs_updated_dict = copy.deepcopy(original_dict)
-            rhs_updated_dict.update(dict(zip(new_variables_list, instances_list[1])))
-            new_children.append(self._scan_expr_tree(expression, rhs_updated_dict))
-            # even if it is a max or min operation, when there are only 2 left, we just do "> or <"
+            for instance_idx in range(len(instances_list)):
+                updated_dict = copy.deepcopy(original_dict)
+                updated_dict.update(dict(zip(new_variables_list, instances_list[instance_idx])))
+                new_children.append(self._scan_expr_tree(expression, updated_dict))
+            #--end for loop through instances
             new_expr = Expression((operation_string, tuple(new_children)))
-        else:  # recursive case
-            if operation_string in {'+', '*', '^', '|'}:  # those ">,<" are for the min and max respectively
-                new_children = []
-                lhs_updated_dict = copy.deepcopy(original_dict)
-                lhs_updated_dict.update(dict(zip(new_variables_list, instances_list[0])))
-                instances_list = instances_list[1:]  # remove the first element before the recursion, simple.
-                new_children.append(self._scan_expr_tree(expression, lhs_updated_dict))
-                new_children.append(
-                    self.do_aggregate_expression_nesting(original_dict,
-                                                         new_variables_list,
-                                                         instances_list,
-                                                         operation_string, expression))
-                new_expr = Expression((operation_string, tuple(new_children)))
-            else:  # Handling the min and max case.
-                # this is done by comparing two at a time, and recursively calling with the remainder of the list
-                # keeping the one that "wins" the comparison. Eg: if (a > b) then (>, [a, rest of list]) else (>, [b, rest of list])
-                # I assume if they are equal, we have a default behavior in the simulator (eg: take first arg)
-                lhs_updated_dict = copy.deepcopy(original_dict)
-                lhs_updated_dict.update(dict(zip(new_variables_list, instances_list[0])))
-                lhs_comparison_arg = self._scan_expr_tree(expression, lhs_updated_dict)
-                rhs_updated_dict = copy.deepcopy(original_dict)
-                rhs_updated_dict.update(dict(zip(new_variables_list, instances_list[1])))
-                rhs_comparison_arg = self._scan_expr_tree(expression, rhs_updated_dict)
-                comparison_expression = Expression(
-                    (operation_string, (lhs_comparison_arg, rhs_comparison_arg)))
-                new_expr = Expression(
-                    ('if', (comparison_expression,
-                            self.do_aggregate_expression_nesting(
-                                original_dict, new_variables_list,
-                                [instances_list[0]] + instances_list[2:],
-                                operation_string, expression),
-                            self.do_aggregate_expression_nesting(
-                                original_dict, new_variables_list,
-                                [instances_list[1]] + instances_list[2:],
-                                operation_string, expression))))
-    
         return new_expr
 
+
+
+
     def _scan_expr_tree_pvar(self, expr: Expression, dic) -> Expression:
         """Ground out a pvar expression."""
         if expr.args[1] is None:
diff --git a/Simulator/RDDLDependencyAnalysis.py b/Simulator/RDDLDependencyAnalysis.py
index a827355e..ef1a7b1c 100644
--- a/Simulator/RDDLDependencyAnalysis.py
+++ b/Simulator/RDDLDependencyAnalysis.py
@@ -1,3 +1,4 @@
+import itertools
 from typing import Dict, List, Set
 
 from Grounder.RDDLModel import PlanningModel
@@ -17,78 +18,82 @@ class RDDLDependencyAnalysis:
     def __init__(self, model: PlanningModel) -> None:
         self._model = model
     
-    @staticmethod
-    def _print_stack_trace(expr):
-        return '...\n' + str(expr) + '\n...'
-    
     # dependency analysis
     def build_call_graph(self) -> Dict[str, Set[str]]:
         graph = {}
-        for var, expr in self._model.cpfs.items():
-            self._update_call_graph(graph, var, expr, expr)
-        
+        for cpf, expr in self._model.cpfs.items():
+            self._update_call_graph(graph, cpf, expr)
+            if cpf not in graph:  # CPF without dependencies
+                graph[cpf] = set()
+                
         # check validity of reward, constraints etc
         expr = self._model.reward
-        self._update_call_graph({}, '', expr, expr)
+        self._update_call_graph({}, '', expr)
         for expr in self._model.preconditions:
-            self._update_call_graph({}, '', expr, expr)
+            self._update_call_graph({}, '', expr)
         for expr in self._model.invariants:
-            self._update_call_graph({}, '', expr, expr)
+            self._update_call_graph({}, '', expr)
             
         return graph
     
-    def _assert_valid_variable(self, expr, var):
+    def _update_call_graph(self, graph, cpf, expr):
+        etype, _ = expr.etype
+        if etype == 'pvar':
+            var = expr.args[0]
+            if var not in self._model.nonfluents:
+                self._assert_valid_variable(cpf, var)
+                graph.setdefault(cpf, set()).add(var)
+        elif etype != 'constant':
+            for arg in expr.args:
+                self._update_call_graph(graph, cpf, arg)
+    
+    def _assert_valid_variable(self, cpf, var):
         if var not in self._model.derived \
             and var not in self._model.interm \
             and var not in self._model.states \
             and var not in self._model.prev_state \
             and var not in self._model.actions:
                 raise RDDLUndefinedVariableError(
-                    'Variable {} is not defined in the instance.'.format(var) + 
-                    '\n' + RDDLDependencyAnalysis._print_stack_trace(expr))
+                    'Variable {} found in CPF {} is not defined.'.format(var, cpf))
                 
-    def _update_call_graph(self, graph, root_var, expr, parent_expr):
-        etype, _ = expr.etype
-        args = expr.args
-        if etype == 'pvar':
-            var = expr.args[0]
-            if var not in self._model.nonfluents:
-                self._assert_valid_variable(parent_expr, var)
-                if root_var not in graph:
-                    graph[root_var] = set()
-                graph[root_var].add(var)
-        elif etype != 'constant':
-            for arg in args:
-                self._update_call_graph(graph, root_var, arg, parent_expr)
-    
     # topological sort
     def compute_levels(self) -> Dict[int, Set[str]]:
         graph = self.build_call_graph()
+
+        # topological sort of variables
         order = []
         temp = set()
         unmarked = set(graph.keys()).union(*graph.values())
         while unmarked:
             var = next(iter(unmarked))
             self._sort_variables(order, graph, var, unmarked, temp)
-        order = [var for var in order if var in self._model.cpfs]
-        order = [(self._model.prev_state[var] if var in self._model.prev_state else var) 
-                 for var in order]
-        order = [{var} for var in order]
-        levels = dict(enumerate(order))
-        return levels
         
+        # stratify levels
+        levels = {}
+        result = {}
+        for var in order:
+            if var in self._model.cpfs:
+                level = 0
+                for child in graph[var]:
+                    if child in self._model.cpfs:
+                        level = max(level, levels[child] + 1)
+                unprimed = self._model.prev_state.get(var, var)
+                result.setdefault(level, set()).add(unprimed)
+                levels[var] = level
+        return result
+    
     def _sort_variables(self, order, graph, var, unmarked, temp):
         if var not in unmarked:
             return
-        if var in temp:
+        elif var in temp:
             raise RDDLCyclicDependencyInCPFError(
-                'CPF {} has a cyclic dependency!'.format(var) + 
-                '\n' + RDDLDependencyAnalysis._print_stack_trace(self._model.cpfs[var]))
-        temp.add(var)
-        if var in graph:
-            for dep in graph[var]:
-                self._sort_variables(order, graph, dep, unmarked, temp)
-        temp.remove(var)
-        unmarked.remove(var)
-        order.append(var)
+                'Cyclic dependency detected, suspected CPFs {}.'.format(temp))
+        else:
+            temp.add(var)
+            if var in graph:
+                for dep in graph[var]:
+                    self._sort_variables(order, graph, dep, unmarked, temp)
+            temp.remove(var)
+            unmarked.remove(var)
+            order.append(var)
         
diff --git a/Simulator/RDDLSimulator.py b/Simulator/RDDLSimulator.py
index 2733b62c..3e0756f0 100644
--- a/Simulator/RDDLSimulator.py
+++ b/Simulator/RDDLSimulator.py
@@ -46,6 +46,13 @@ class RDDLActionPreconditionNotSatisfiedError(ValueError):
     pass
 
 
+VALID_ARITHMETIC_OPS = {'+', '-', '*', '/'}
+VALID_RELATIONAL_OPS = {'>=', '>', '<=', '<', '==', '~='}
+VALID_LOGICAL_OPS = {'|', '^', '~', '=>', '<=>'}
+VALID_AGGREGATE_OPS = {'minimum', 'maximum'}
+VALID_CONTROL_OPS = {'if'}
+
+
 class RDDLSimulator:
     
     def __init__(self,
@@ -110,7 +117,7 @@ def check_state_invariants(self) -> None:
                 raise RDDLTypeError(
                     'State invariant must evaluate to bool, got {}.'.format(sample) + 
                     '\n' + RDDLSimulator._print_stack_trace(invariant))
-            if not sample:
+            elif not sample:
                 raise RDDLStateInvariantNotSatisfiedError(
                     'State invariant {} is not satisfied.'.format(idx + 1) + 
                     '\n' + RDDLSimulator._print_stack_trace(invariant))
@@ -124,7 +131,7 @@ def check_action_preconditions(self) -> None:
                 raise RDDLTypeError(
                     'Action precondition must evaluate to bool, got {}.'.format(sample) + 
                     '\n' + RDDLSimulator._print_stack_trace(precondition))
-            if not sample:
+            elif not sample:
                 raise RDDLActionPreconditionNotSatisfiedError(
                     'Action precondition {} is not satisfied.'.format(idx + 1) + 
                     '\n' + RDDLSimulator._print_stack_trace(precondition))
@@ -196,23 +203,25 @@ def update_state(self, forced_state=None) -> None:
     # TODO:    replace isinstance checks with something better (polymorphism)    
     def _sample(self, expr, subs):
         if isinstance(expr, Expression):
-            etype, eop = expr.etype
+            etype, op = expr.etype
             if etype == 'constant':
                 return self._sample_constant(expr, subs)
             elif etype == 'pvar':
-                return self._sample_pvar(expr, eop, subs)
+                return self._sample_pvar(expr, op, subs)
             elif etype == 'relational':
-                return self._sample_relational(expr, eop, subs)
+                return self._sample_relational(expr, op, subs)
             elif etype == 'arithmetic':
-                return self._sample_arithmetic(expr, eop, subs)
+                return self._sample_arithmetic(expr, op, subs)
+            elif etype == 'aggregation':
+                return self._sample_aggregation(expr, op, subs)
             elif etype == 'func':
-                return self._sample_func(expr, eop, subs)
+                return self._sample_func(expr, op, subs)
             elif etype == 'boolean':
-                return self._sample_logical(expr, eop, subs)
+                return self._sample_logical(expr, op, subs)
             elif etype == 'control':
-                return self._sample_control(expr, eop, subs)
+                return self._sample_control(expr, op, subs)
             elif etype == 'randomvar':
-                return self._sample_random(expr, eop, subs)
+                return self._sample_random(expr, op, subs)
             else:
                 raise RDDLNotImplementedError(
                     'Internal error: expression type {} is not supported.'.format(etype) + 
@@ -230,7 +239,7 @@ def _sample_pvar(self, expr, name, subs):
         args = expr.args
         if len(args) != 2:
             raise RDDLInvalidNumberOfArgumentsError(
-                'Internal error: pvar {} requires 2 args, got {}'.format(expr, len(args)) + 
+                'Internal error: pvar {} requires 2 args, got {}.'.format(expr, len(args)) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
         
         var = args[0]
@@ -238,23 +247,30 @@ def _sample_pvar(self, expr, name, subs):
             raise RDDLUndefinedVariableError(
                 'Variable {} is not defined in the instance.'.format(var) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
+            
         val = subs[var]
-        
         if val is None:
             raise RDDLUndefinedVariableError(
                 'The value of variable {} is not set.'.format(var) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
+            
         return val
     
-    def _sample_relational(self, expr, eop, subs):
+    def _sample_relational(self, expr, op, subs):
+        if op not in VALID_RELATIONAL_OPS:
+            raise RDDLNotImplementedError(
+                'Relational operator {} is not supported: must be one of {}.'.format(
+                    op, VALID_RELATIONAL_OPS) + 
+                '\n' + RDDLSimulator._print_stack_trace(expr))
+            
         args = expr.args
         if not isinstance(args, Sized):
             raise RDDLTypeError(
                 'Internal error: expected Sized, got {}.'.format(type(args)) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
-        if len(args) != 2:
+        elif len(args) != 2:
             raise RDDLInvalidNumberOfArgumentsError(
-                'Relational expression {} requires 2 args, got {}.'.format(eop, len(args)) + 
+                'Relational operator {} requires 2 args, got {}.'.format(op, len(args)) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
         
         arg1 = self._sample(args[0], subs)
@@ -262,84 +278,108 @@ def _sample_relational(self, expr, eop, subs):
         arg1 = 1 * arg1  # bool -> int
         arg2 = 1 * arg2
         
-        if eop == '>=':
+        if op == '>=':
             return arg1 >= arg2
-        elif eop == '<=':
+        elif op == '<=':
             return arg1 <= arg2
-        elif eop == '<':
+        elif op == '<':
             return arg1 < arg2
-        elif eop == '>':
+        elif op == '>':
             return arg1 > arg2
-        elif eop == '==':
+        elif op == '==':
             return arg1 == arg2
-        elif eop == '~=':
+        else:  # '!='
             return arg1 != arg2
-        else:
+    
+    def _sample_arithmetic(self, expr, op, subs):
+        if op not in VALID_ARITHMETIC_OPS:
             raise RDDLNotImplementedError(
-                'Relational operator {} is not supported.'.format(eop) + 
+                'Arithmetic operator {} is not supported: must be one of {}.'.format(
+                    op, VALID_ARITHMETIC_OPS) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
-    
-    def _sample_arithmetic(self, expr, eop, subs):
+        
         args = expr.args        
-        if len(args) == 1 and eop == '-':
+          
+        if len(args) == 1 and op == '-':
             arg = self._sample(args[0], subs)
-            return -1 * arg  # bool -> int        
-        elif len(args) == 2:
-            if eop == '*':
-                return self._sample_short_circuit_product(expr, *args, subs)
-            else:
+            arg = -1 * arg  # bool -> int  
+            return arg
+        
+        elif len(args) >= 1:
+            if op == '*':
+                return self._sample_short_circuit_product(expr, args, subs)
+            elif op == '+':
+                terms = (1 * self._sample(arg, subs) for arg in args)  # bool -> int
+                return sum(terms)
+            elif len(args) == 2:
                 arg1 = self._sample(args[0], subs)
                 arg2 = self._sample(args[1], subs)
-                return RDDLSimulator._apply_arithmetic_rule(expr, arg1, arg2, eop)        
-        else:
-            raise RDDLInvalidNumberOfArgumentsError(
-                'Arithmetic operator {} requires 2 args, got {}'.format(eop, len(args)) + 
-                '\n' + RDDLSimulator._print_stack_trace(expr))
-    
-    @staticmethod
-    def _apply_arithmetic_rule(expr, arg1, arg2, op):
-        arg1 = 1 * arg1  # bool -> int
-        arg2 = 1 * arg2
+                arg1 = 1 * arg1  # bool -> int
+                arg2 = 1 * arg2
+                if op == '-':
+                    return arg1 - arg2
+                elif op == '/':
+                    return RDDLSimulator._safe_division(expr, arg1, arg2)
             
-        if op == '+':
-            return arg1 + arg2
-        elif op == '-':
-            return arg1 - arg2
-        elif op == '*':
-            return arg1 * arg2
-        elif op == '/':
-            return RDDLSimulator._safe_division(expr, arg1, arg2) 
-        else:
-            raise RDDLNotImplementedError(
-                'Arithmetic operator {} is not supported.'.format(op) + 
-                '\n' + RDDLSimulator._print_stack_trace(expr))
+        raise RDDLInvalidNumberOfArgumentsError(
+            'Arithmetic operator {} does not have the required number of args, got {}.'.format(
+                op, len(args)) + 
+            '\n' + RDDLSimulator._print_stack_trace(expr))
     
     @staticmethod
     def _safe_division(expr, arg1, arg2):
         if arg1 != arg1 or arg2 != arg2:
             raise ArithmeticError(
-                'Invalid (NaN) values in quotient: {} and {}.'.format(arg1, arg2) + 
+                'Invalid (NaN) values in quotient, got {} and {}.'.format(arg1, arg2) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
         elif arg2 == 0:
             raise ArithmeticError(
                 'Division by zero.' + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
-        else:
-            return arg1 / arg2  # int -> float
         
-    def _sample_short_circuit_product(self, expr, expr1, expr2, subs):
-        if expr2.is_constant_expression() or expr2.is_pvariable_expression():  # TODO: is this ok?
-            expr1, expr2 = expr2, expr1
+        return arg1 / arg2  # int -> float
         
-        arg1 = self._sample(expr1, subs)
-        arg1 = 1 * arg1  # bool -> int
-        if arg1 == 0:
-            return arg1
+    def _sample_short_circuit_product(self, expr, args, subs):
+        product = 1
+        
+        # evaluate variables and constants first (these are fast)
+        for arg in args:
+            if arg.is_constant_expression() or arg.is_pvariable_expression():
+                term = self._sample(arg, subs)
+                product *= term  # bool -> int
+                if product == 0:
+                    return product
         
-        arg2 = self._sample(expr2, subs)
-        arg2 = 1 * arg2  # bool -> int
-        return arg1 * arg2
+        # evaluate nested expressions (can't optimize the order in general)
+        for arg in args:
+            if not (arg.is_constant_expression() or arg.is_pvariable_expression()):
+                term = self._sample(arg, subs)
+                product *= term  # bool -> int
+                if product == 0:
+                    return product
+                
+        return product
     
+    # aggregations
+    def _sample_aggregation(self, expr, op, subs):
+        if op not in VALID_AGGREGATE_OPS:
+            raise RDDLNotImplementedError(
+                'Aggregation operator {} is not supported: must be one of {}.'.format(
+                    op, VALID_AGGREGATE_OPS) + 
+                '\n' + RDDLSimulator._print_stack_trace(expr))
+        
+        args = expr.args
+        if not args:
+            raise RDDLInvalidNumberOfArgumentsError(
+                'Aggregation operator {} requires at least 1 arg, got {}.'.format(op, len(args)) + 
+                '\n' + RDDLSimulator._print_stack_trace(expr))
+        
+        terms = (1 * self._sample(arg, subs) for arg in args)  # bool -> int
+        if op == 'minimum':
+            return min(terms)
+        else:  # 'maximum'
+            return max(terms)
+        
     # functions
     KNOWN_UNARY = {        
         'abs': abs,
@@ -382,7 +422,7 @@ def _sample_func(self, expr, name, subs):
         if name in RDDLSimulator.KNOWN_UNARY:
             if len(args) != 1:
                 raise RDDLInvalidNumberOfArgumentsError(
-                    'Function {} requires 1 arg, got {}.'.format(name, len(args)) + 
+                    'Unary function {} requires 1 arg, got {}.'.format(name, len(args)) + 
                     '\n' + RDDLSimulator._print_stack_trace(expr))    
                             
             arg = self._sample(args[0], subs)
@@ -391,13 +431,13 @@ def _sample_func(self, expr, name, subs):
                 return RDDLSimulator.KNOWN_UNARY[name](arg)
             except:
                 raise RDDLValueOutOfRangeError(
-                    'Function {} could not be evaluated with arg {}.'.format(name, arg) + 
+                    'Unary function {} could not be evaluated with arg {}.'.format(name, arg) + 
                     '\n' + RDDLSimulator._print_stack_trace(expr))
         
         elif name in RDDLSimulator.KNOWN_BINARY:
             if len(args) != 2:
                 raise RDDLInvalidNumberOfArgumentsError(
-                    'Function {} requires 2 args, got {}.'.format(name, len(args)) + 
+                    'Binary function {} requires 2 args, got {}.'.format(name, len(args)) + 
                     '\n' + RDDLSimulator._print_stack_trace(expr))      
                           
             arg1 = self._sample(args[0], subs)
@@ -408,7 +448,7 @@ def _sample_func(self, expr, name, subs):
                 return RDDLSimulator.KNOWN_BINARY[name](arg1, arg2)
             except:
                 raise RDDLValueOutOfRangeError(
-                    'Function {} could not be evaluated with args {} and {}.'.format(
+                    'Binary function {} could not be evaluated with args {} and {}.'.format(
                         name, arg1, arg2) + 
                     '\n' + RDDLSimulator._print_stack_trace(expr))
         
@@ -418,64 +458,77 @@ def _sample_func(self, expr, name, subs):
                 '\n' + RDDLSimulator._print_stack_trace(expr))   
     
     # logical expressions
-    def _sample_logical(self, expr, eop, subs):
+    def _sample_logical(self, expr, op, subs):
+        if op not in VALID_LOGICAL_OPS:
+            raise RDDLNotImplementedError(
+                'Logical operator {} is not supported: must be one of {}.'.format(
+                    op, VALID_LOGICAL_OPS) + 
+                '\n' + RDDLSimulator._print_stack_trace(expr))
+        
         args = expr.args
-        if len(args) == 1 and eop == '~':
+        
+        if len(args) == 1 and op == '~':
             arg = self._sample(args[0], subs)
             if not isinstance(arg, bool):
                 raise RDDLTypeError(
-                    'Logical operator {} requires boolean arg, got {}.'.format(eop, arg) + 
+                    'Logical operator {} requires boolean arg, got {}.'.format(op, arg) + 
                     '\n' + RDDLSimulator._print_stack_trace(expr))
             return not arg
         
-        elif len(args) == 2:
-            if eop == '|' or eop == '^':
-                return self._sample_short_circuit_and_or(expr, *args, eop, subs)
-            elif eop == '~':
-                return self._sample_xor(expr, *args, subs)
-            elif eop == '=>':
-                return self._sample_short_circuit_implies(expr, *args, subs)
-            elif eop == '<=>':
-                return self._sample_equivalent(expr, *args, subs)
-            else:
-                raise RDDLNotImplementedError(
-                    'Logical operator {} is not supported.'.format(eop) + 
-                    '\n' + RDDLSimulator._print_stack_trace(expr))
+        elif len(args) >= 1:
+            if op == '|' or op == '^':
+                return self._sample_short_circuit_and_or(expr, args, op, subs)
+            elif len(args) == 2:
+                if op == '~':
+                    return self._sample_xor(expr, *args, subs)
+                elif op == '=>':
+                    return self._sample_short_circuit_implies(expr, *args, subs)
+                elif op == '<=>':
+                    return self._sample_equivalent(expr, *args, subs)
                 
-        else:
-            raise RDDLInvalidNumberOfArgumentsError(
-                'Logical operator {} require 2 args, got {}'.format(eop, len(args)) + 
-                '\n' + RDDLSimulator._print_stack_trace(expr))
-        
-    def _sample_short_circuit_and_or(self, expr, expr1, expr2, op, subs):
-        if expr2.is_constant_expression() or expr2.is_pvariable_expression():  # TODO: is this ok?
-            expr1, expr2 = expr2, expr1
-        
-        arg1 = self._sample(expr1, subs)
-        if not isinstance(arg1, bool):
-            raise RDDLTypeError(
-                'Logical operator {} requires boolean arg, got {}.'.format(op, arg1) + 
-                '\n' + RDDLSimulator._print_stack_trace(expr))
-            
-        if op == '|' and arg1:
-            return True
-        elif op == '^' and not arg1:
-            return False
-        
-        arg2 = self._sample(expr2, subs)
-        if not isinstance(arg1, bool):
-            raise RDDLTypeError(
-                'Logical operator {} requires boolean arg, got {}.'.format(op, arg2) + 
-                '\n' + RDDLSimulator._print_stack_trace(expr))
-        return arg2
-        
+        raise RDDLInvalidNumberOfArgumentsError(
+            'Logical operator {} does not have the required number of args, got {}.'.format(
+                op, len(args)) + 
+            '\n' + RDDLSimulator._print_stack_trace(expr))
+        
+    def _sample_short_circuit_and_or(self, expr, args, op, subs):
+        
+        # evaluate variables and constants first (these are fast)
+        for arg in args:
+            if arg.is_constant_expression() or arg.is_pvariable_expression():
+                term = self._sample(arg, subs)
+                if not isinstance(term, bool):
+                    raise RDDLTypeError(
+                        'Logical operator {} requires boolean arg, got {}.'.format(op, term) + 
+                        '\n' + RDDLSimulator._print_stack_trace(expr))
+                if op == '|' and term:
+                    return True
+                elif op == '^' and not term:
+                    return False
+        
+        # evaluate nested expressions (can't optimize the order in general)
+        for arg in args:
+            if not (arg.is_constant_expression() or arg.is_pvariable_expression()):
+                term = self._sample(arg, subs)
+                if not isinstance(term, bool):
+                    raise RDDLTypeError(
+                        'Logical operator {} requires boolean arg, got {}.'.format(op, term) + 
+                        '\n' + RDDLSimulator._print_stack_trace(expr))
+                if op == '|' and term:
+                    return True
+                elif op == '^' and not term:
+                    return False
+        
+        return op != '|'
+    
     def _sample_xor(self, expr, arg1, arg2, subs):
         arg1 = self._sample(arg1, subs)
         arg2 = self._sample(arg2, subs)
         if not (isinstance(arg1, bool) and isinstance(arg2, bool)):
             raise RDDLTypeError(
-                'Xor requires boolean args, got {} and {}.'.format(arg1, arg2) + 
+                'Logical operator ~ requires boolean args, got {} and {}.'.format(arg1, arg2) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
+            
         return arg1 != arg2
     
     def _sample_short_circuit_implies(self, expr, arg1, arg2, subs):
@@ -493,6 +546,7 @@ def _sample_short_circuit_implies(self, expr, arg1, arg2, subs):
             raise RDDLTypeError(
                 'Logical operator => requires boolean args, got {} and {}.'.format(arg1, arg2) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr)) 
+            
         return arg2
     
     def _sample_equivalent(self, expr, arg1, arg2, subs):
@@ -500,28 +554,33 @@ def _sample_equivalent(self, expr, arg1, arg2, subs):
         arg2 = self._sample(arg2, subs)
         if not (isinstance(arg1, bool) and isinstance(arg2, bool)):
             raise RDDLTypeError(
-                '<=> requires boolean args, got {} and {}.'.format(arg1, arg2) + 
+                'Logical operator <=> requires boolean args, got {} and {}.'.format(arg1, arg2) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
+            
         return arg1 == arg2
         
     # control
-    def _sample_control(self, expr, eop, subs):
-        args = expr.args
-        if eop != 'if':
+    def _sample_control(self, expr, op, subs):
+        if op not in VALID_CONTROL_OPS:
             raise RDDLNotImplementedError(
-                'Control type {} is not supported.'.format(eop) + 
+                'Control structure {} is not supported, must be one of {}.'.format(
+                    op, VALID_CONTROL_OPS) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
+        
+        args = expr.args
         if len(args) != 3:
             raise RDDLInvalidNumberOfArgumentsError(
-                'If statement requires 3 args, got {}.'.format(len(args)) + 
+                'If statement requires 3 statements, got {}.'.format(len(args)) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
         
-        cond = self._sample(args[0], subs)
-        if not isinstance(cond, bool):
+        condition = self._sample(args[0], subs)
+        if not isinstance(condition, bool):
             raise RDDLTypeError(
-                'If condition must evaluate to bool, got {}.'.format(cond) + 
+                'If condition must evaluate to bool, got {}.'.format(condition) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
-        return self._sample(args[1 if cond else 2], subs)
+        
+        branch = args[1 if condition else 2]
+        return self._sample(branch, subs)
         
     # random variables
     def _sample_random(self, expr, name, subs):
@@ -543,19 +602,7 @@ def _sample_random(self, expr, name, subs):
             return self._sample_weibull(expr, subs)        
         elif name == 'Gamma':
             return self._sample_gamma(expr, subs)
-        elif name == 'Discrete':  # no support for enum
-            raise RDDLNotImplementedError(
-                'Discrete is not supported.' + 
-                '\n' + RDDLSimulator._print_stack_trace(expr))
-        elif name == 'Multinomial':  # no support for enum
-            raise RDDLNotImplementedError(
-                'Multinomial is not supported.' + 
-                '\n' + RDDLSimulator._print_stack_trace(expr))            
-        elif name == 'Dirichlet':  # no support for enum
-            raise RDDLNotImplementedError(
-                'Dirichlet is not supported.' + 
-                '\n' + RDDLSimulator._print_stack_trace(expr))     
-        else:
+        else:  # no support for enum
             raise RDDLNotImplementedError(
                 'Distribution {} is not supported.'.format(name) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
@@ -572,6 +619,7 @@ def _sample_kron_delta(self, expr, subs):
             raise RDDLTypeError(
                 'KronDelta requires int or boolean parameter, got {}.'.format(arg) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
+            
         return arg
     
     def _sample_dirac_delta(self, expr, subs):
@@ -586,6 +634,7 @@ def _sample_dirac_delta(self, expr, subs):
             raise RDDLTypeError(
                 'DiracDelta requires float parameter, got {}.'.format(arg) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
+            
         return arg
     
     def _sample_uniform(self, expr, subs):
@@ -632,9 +681,9 @@ def _sample_normal(self, expr, subs):
             raise RDDLValueOutOfRangeError(
                 'Normal variance {} is not positive.'.format(var) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
-        stdev = math.sqrt(var)
-        
-        return self._rng.normal(loc=mean, scale=stdev)
+            
+        scale = math.sqrt(var)
+        return self._rng.normal(loc=mean, scale=scale)
     
     def _sample_poisson(self, expr, subs):
         args = expr.args
@@ -699,7 +748,7 @@ def _sample_gamma(self, expr, subs):
             raise RDDLValueOutOfRangeError(
                 'Gamma shape {} is not positive.'.format(shape) + 
                 '\n' + RDDLSimulator._print_stack_trace(expr))
-        
+            
         scale = float(self._sample(args[1], subs))
         if not (scale > 0.):
             raise RDDLValueOutOfRangeError(
@@ -741,14 +790,13 @@ def __init__(self,
 
     def _parse_bounds_rec(self, cond, search_dict):
         if cond.etype[0] == "boolean" and cond.etype[1] == "^":
-            self._parse_bounds_rec(cond.args[0], search_dict)     # left term
-            self._parse_bounds_rec(cond.args[1], search_dict)     # right term
+            self._parse_bounds_rec(cond.args[0], search_dict)  # left term
+            self._parse_bounds_rec(cond.args[1], search_dict)  # right term
         if cond.etype[0] == "relational":
             var, lim, loc = self.get_bounds(cond.args[0], cond.args[1], cond.etype[1], search_dict)
             if var is not None and loc is not None:
                 self._bounds[var][loc] = lim
 
-
     def get_bounds(self, left_arg, right_arg, op, search_dict=None) -> Tuple[str, float, int]:
         variable = None
         lim = 0
diff --git a/_deprecated.py b/_deprecated.py
index 4af92316..d75d7b0e 100644
--- a/_deprecated.py
+++ b/_deprecated.py
@@ -1,45 +1,162 @@
-# TESTING OLD
+from Parser import parser as parser
+from Parser import RDDLReader as RDDLReader
+import Grounder.RDDLGrounder as RDDLGrounder
+from Simulator.RDDLSimulator import RDDLSimulator
+
+DOMAIN = 'power_unit_commitment.rddl'
+
+# DOMAIN = 'ThiagosReservoir.rddl'
+# DOMAIN = 'Thiagos_Mars_Rover.rddl'
+# DOMAIN = 'dbn_prop.rddl'
+# DOMAIN = 'RamMod_Thiagos_HVAC.rddl'
+DOMAIN = 'RamMod_smaller_Thiagos_HVAC.rddl'
+# DOMAIN = 'RamMod_Thiagos_HVAC_grounded.rddl'
+
+# DOMAIN = 'Thiagos_HVAC.rddl'
+# DOMAIN = 'Thiagos_HVAC_grounded.rddl'
+# DOMAIN = 'wildfire_mdp.rddl'
+DOMAIN = 'recsim_ecosystem_welfare.rddl'
+
+def main():
+
+    MyReader = RDDLReader.RDDLReader('RDDL/' + DOMAIN)
+    # MyReader = RDDLReader.RDDLReader('RDDL/power_unit_commitment_domain.rddl',
+    #                                  'RDDL/power_unit_commitment_instance.rddl')
+    domain = MyReader.rddltxt
+
+    MyLexer = parser.RDDLlex()
+    MyLexer.build()
+    MyLexer.input(domain)
+    # [token for token in MyLexer._lexer]
+
+    # build parser - built in lexer, non verbose
+    MyRDDLParser = parser.RDDLParser(None, False)
+    MyRDDLParser.build()
+
+    # parse RDDL file
+    rddl_ast = MyRDDLParser.parse(domain)
+
+    # MyXADDTranslator = XADDTranslator(rddl_ast)
+    # MyXADDTranslator.Translate()
+
+    from pprint import pprint
+    grounder = RDDLGrounder.RDDLGrounder(rddl_ast)
+    model = grounder.Ground()
+    # print(model.states)
+    # print(model.init_state)
+    # for cpf_key, primed_cpf in model.interm.items():
+    #     expr = model.cpfs[primed_cpf]
+    #     print(primed_cpf, expr)
+    # print(model.cpfs)
+    # pprint(vars(model))
+    # #
+    # good_policy = True
+    sampler = RDDLSimulator(model)
+    loops = 1
+    #
+    print('\nstarting simulation')
+    for h in range(loops):
+        state = sampler.reset_state()
+        print(state)
+        action = {
+        'recommend(c1, i1)': True,
+        'recommend(c2, i2)': True,
+        'recommend(c3, i3)': True,
+        'recommend(c4, i4)': True,
+        'recommend(c5, i5)': True,
+        }
+        state = sampler.sample_next_state(action)
+        print(state)
+    #     total_reward = 0.
+    #     for _ in range(2000):
+    #         sampler.check_state_invariants()
+    #         sampler.check_action_preconditions()
+    #         actions = {'AIR_r1': 0., 'AIR_r2': 0., 'AIR_r3': 0.}
+    #         if good_policy:
+    #             if state['TEMP_r1'] < 20.5:
+    #                 actions['AIR_r1'] = 5.
+    #             if state['TEMP_r2'] < 20.5:
+    #                 actions['AIR_r2'] = 5.
+    #             if state['TEMP_r3'] < 20.5:
+    #                 actions['AIR_r3'] = 5.
+    #             if state['TEMP_r1'] > 23.:
+    #                 actions['AIR_r1'] = 0.
+    #             if state['TEMP_r2'] > 23.:
+    #                 actions['AIR_r2'] = 0.
+    #             if state['TEMP_r3'] > 23.:
+    #                 actions['AIR_r3'] = 0.
+    #         state = sampler.sample_next_state(actions)
+    #         reward = sampler.sample_reward()
+    #         sampler.update_state()
+    #         if h == 0:
+    #             print('state = {}'.format(state))
+    #             print('reward = {}'.format(reward))
+    #             print('derived = {}'.format(model.derived))
+    #             print('interm = {}'.format(model.interm))
+    #             print('')
+    #         total_reward += reward
+    #     print('trial {}, total reward {}'.format(h, total_reward))
+
+    # grounder = RDDLGrounder.RDDLGrounder(rddl_ast)
+    # grounder.Ground()
+    # pprint(vars(grounder))
+
+    # grounder.InitGround()
+    # generator = RDDLGenerator.RDDLGenerator(rddl_ast)
+    # rddl = generator.GenerateRDDL()
+
+
+    print("reached end of test.py")
+
+if __name__ == "__main__":
+    main()
+
+
+
+
 # from Parser import parser as parser
 # from Parser import RDDLReader as RDDLReader
 # import Grounder.RDDLGrounder as RDDLGrounder
-# from Simulator.RDDLSimulator import RDDLSimulator
-#
+# from Visualizer.MarsRoverDisplay import MarsRoverDisplay
+# from Visualizer.ReservoirDisplay import ReservoirDisplay
+# from Visualizer.HVACDisplay import HVACDisplay
+
 # DOMAIN = 'power_unit_commitment.rddl'
-#
+
 # # DOMAIN = 'ThiagosReservoir.rddl'
+# DOMAIN = 'ThiagosReservoir_grounded.rddl'
 # # DOMAIN = 'Thiagos_Mars_Rover.rddl'
-# # DOMAIN = 'dbn_prop.rddl'
-# # DOMAIN = 'RamMod_Thiagos_HVAC.rddl'
-# DOMAIN = 'RamMod_smaller_Thiagos_HVAC.rddl'
-# # DOMAIN = 'RamMod_Thiagos_HVAC_grounded.rddl'
-#
+# # DOMAIN = 'Thiagos_Mars_Rover_grounded.rddl'
 # # DOMAIN = 'Thiagos_HVAC.rddl'
+# # DOMAIN = 'dbn_prop.rddl'
 # # DOMAIN = 'Thiagos_HVAC_grounded.rddl'
 # # DOMAIN = 'wildfire_mdp.rddl'
 # DOMAIN = 'recsim_ecosystem_welfare.rddl'
-#
+
 # def main():
-#
+
 #     MyReader = RDDLReader.RDDLReader('RDDL/' + DOMAIN)
 #     # MyReader = RDDLReader.RDDLReader('RDDL/power_unit_commitment_domain.rddl',
 #     #                                  'RDDL/power_unit_commitment_instance.rddl')
 #     domain = MyReader.rddltxt
-#
+
 #     MyLexer = parser.RDDLlex()
 #     MyLexer.build()
 #     MyLexer.input(domain)
 #     # [token for token in MyLexer._lexer]
-#
+
 #     # build parser - built in lexer, non verbose
 #     MyRDDLParser = parser.RDDLParser(None, False)
 #     MyRDDLParser.build()
-#
+
 #     # parse RDDL file
 #     rddl_ast = MyRDDLParser.parse(domain)
-#
+
+
+
 #     # MyXADDTranslator = XADDTranslator(rddl_ast)
 #     # MyXADDTranslator.Translate()
-#
+
 #     from pprint import pprint
 #     grounder = RDDLGrounder.RDDLGrounder(rddl_ast)
 #     model = grounder.Ground()
@@ -54,7 +171,7 @@
 #     # good_policy = True
 #     sampler = RDDLSimulator(model)
 #     loops = 1
-#     # 
+#     #
 #     print('\nstarting simulation')
 #     for h in range(loops):
 #         state = sampler.reset_state()
@@ -64,8 +181,8 @@
 #         'recommend(c2, i2)': True,
 #         'recommend(c3, i3)': True,
 #         'recommend(c4, i4)': True,
-#         'recommend(c5, i5)': True,        
-#         }      
+#         'recommend(c5, i5)': True,
+#         }
 #         state = sampler.sample_next_state(action)
 #         print(state)
 #     #     total_reward = 0.
@@ -97,150 +214,32 @@
 #     #             print('')
 #     #         total_reward += reward
 #     #     print('trial {}, total reward {}'.format(h, total_reward))
-#
-#     # grounder = RDDLGrounder.RDDLGrounder(rddl_ast)
-#     # grounder.Ground()
-#     # pprint(vars(grounder))
-#
-#     # grounder.InitGround()
+
+#     grounder = RDDLGrounder.RDDLGroundedGrounder(rddl_ast)
+#     model = grounder.Ground()
+#     # marsVisual = MarsRoverDisplay(model, grid_size=[50,50], resolution=[500,500])
+#     # marsVisual.display_img(duration=0.5)
+#     # marsVisual.save_img('./pict2.png')
+
+#     # reservoirVisual = ReservoirDisplay(model, grid_size=[50,50], resolution=[500,500])
+
+#     HVACVisual = HVACDisplay(model, grid_size=[50,50], resolution=[500,500])
+
+
+#     # print(model._nonfluents)
+#     # print(model._states)
+#     # print(model._objects)
+
+
+
 #     # generator = RDDLGenerator.RDDLGenerator(rddl_ast)
 #     # rddl = generator.GenerateRDDL()
-#
-#
+#     # print(rddl)
+
 #     print("reached end of test.py")
-#
+
 # if __name__ == "__main__":
 #     main()
-#
-#
-#
-#
-# # from Parser import parser as parser
-# # from Parser import RDDLReader as RDDLReader
-# # import Grounder.RDDLGrounder as RDDLGrounder
-# # from Visualizer.MarsRoverDisplay import MarsRoverDisplay
-# # from Visualizer.ReservoirDisplay import ReservoirDisplay
-# # from Visualizer.HVACDisplay import HVACDisplay
-#
-# # DOMAIN = 'power_unit_commitment.rddl'
-#
-# # # DOMAIN = 'ThiagosReservoir.rddl'
-# # DOMAIN = 'ThiagosReservoir_grounded.rddl'
-# # # DOMAIN = 'Thiagos_Mars_Rover.rddl'
-# # # DOMAIN = 'Thiagos_Mars_Rover_grounded.rddl'
-# # # DOMAIN = 'Thiagos_HVAC.rddl'
-# # # DOMAIN = 'dbn_prop.rddl'
-# # # DOMAIN = 'Thiagos_HVAC_grounded.rddl'
-# # # DOMAIN = 'wildfire_mdp.rddl'
-# # DOMAIN = 'recsim_ecosystem_welfare.rddl'
-#
-# # def main():
-#
-# #     MyReader = RDDLReader.RDDLReader('RDDL/' + DOMAIN)
-# #     # MyReader = RDDLReader.RDDLReader('RDDL/power_unit_commitment_domain.rddl',
-# #     #                                  'RDDL/power_unit_commitment_instance.rddl')
-# #     domain = MyReader.rddltxt
-#
-# #     MyLexer = parser.RDDLlex()
-# #     MyLexer.build()
-# #     MyLexer.input(domain)
-# #     # [token for token in MyLexer._lexer]
-#
-# #     # build parser - built in lexer, non verbose
-# #     MyRDDLParser = parser.RDDLParser(None, False)
-# #     MyRDDLParser.build()
-#
-# #     # parse RDDL file
-# #     rddl_ast = MyRDDLParser.parse(domain)
-#
-#
-#
-# #     # MyXADDTranslator = XADDTranslator(rddl_ast)
-# #     # MyXADDTranslator.Translate()
-#
-# #     from pprint import pprint
-# #     grounder = RDDLGrounder.RDDLGrounder(rddl_ast)
-# #     model = grounder.Ground()
-# #     # print(model.states)
-# #     # print(model.init_state)
-# #     # for cpf_key, primed_cpf in model.interm.items():
-# #     #     expr = model.cpfs[primed_cpf]
-# #     #     print(primed_cpf, expr)
-# #     # print(model.cpfs)
-# #     # pprint(vars(model))
-# #     # #
-# #     # good_policy = True
-# #     sampler = RDDLSimulator(model)
-# #     loops = 1
-# #     # 
-# #     print('\nstarting simulation')
-# #     for h in range(loops):
-# #         state = sampler.reset_state()
-# #         print(state)
-# #         action = {
-# #         'recommend(c1, i1)': True,
-# #         'recommend(c2, i2)': True,
-# #         'recommend(c3, i3)': True,
-# #         'recommend(c4, i4)': True,
-# #         'recommend(c5, i5)': True,        
-# #         }      
-# #         state = sampler.sample_next_state(action)
-# #         print(state)
-# #     #     total_reward = 0.
-# #     #     for _ in range(2000):
-# #     #         sampler.check_state_invariants()
-# #     #         sampler.check_action_preconditions()
-# #     #         actions = {'AIR_r1': 0., 'AIR_r2': 0., 'AIR_r3': 0.}
-# #     #         if good_policy:
-# #     #             if state['TEMP_r1'] < 20.5:
-# #     #                 actions['AIR_r1'] = 5.
-# #     #             if state['TEMP_r2'] < 20.5:
-# #     #                 actions['AIR_r2'] = 5.
-# #     #             if state['TEMP_r3'] < 20.5:
-# #     #                 actions['AIR_r3'] = 5.
-# #     #             if state['TEMP_r1'] > 23.:
-# #     #                 actions['AIR_r1'] = 0.
-# #     #             if state['TEMP_r2'] > 23.:
-# #     #                 actions['AIR_r2'] = 0.
-# #     #             if state['TEMP_r3'] > 23.:
-# #     #                 actions['AIR_r3'] = 0.
-# #     #         state = sampler.sample_next_state(actions)
-# #     #         reward = sampler.sample_reward()
-# #     #         sampler.update_state()
-# #     #         if h == 0:
-# #     #             print('state = {}'.format(state))
-# #     #             print('reward = {}'.format(reward))
-# #     #             print('derived = {}'.format(model.derived))
-# #     #             print('interm = {}'.format(model.interm))
-# #     #             print('')
-# #     #         total_reward += reward
-# #     #     print('trial {}, total reward {}'.format(h, total_reward))
-#
-# #     grounder = RDDLGrounder.RDDLGroundedGrounder(rddl_ast)
-# #     model = grounder.Ground()
-# #     # marsVisual = MarsRoverDisplay(model, grid_size=[50,50], resolution=[500,500])
-# #     # marsVisual.display_img(duration=0.5)
-# #     # marsVisual.save_img('./pict2.png')
-#
-# #     # reservoirVisual = ReservoirDisplay(model, grid_size=[50,50], resolution=[500,500])
-#
-# #     HVACVisual = HVACDisplay(model, grid_size=[50,50], resolution=[500,500])
-#
-#
-# #     # print(model._nonfluents)
-# #     # print(model._states)
-# #     # print(model._objects)
-#
-#
-#
-# #     # generator = RDDLGenerator.RDDLGenerator(rddl_ast)
-# #     # rddl = generator.GenerateRDDL()
-# #     # print(rddl)
-#
-# #     print("reached end of test.py")
-#
-# # if __name__ == "__main__":
-# #     main()
 
 
 


Test patch:
diff --git a/testGym.py b/testGym.py
index 92f1869c..ece318ff 100644
--- a/testGym.py
+++ b/testGym.py
@@ -1,25 +1,27 @@
 from Env import RDDLEnv as RDDLEnv
 from Policies.Agents import RandomAgent
-
+from Visualizer.MarsRoverViz import MarsRoverVisualizer
 
 # PROBLEM = 'RDDL/Thiagos_HVAC_grounded.rddl'
 # PROBLEM = 'RDDL/Thiagos_Mars_Rover.rddl'
 # PROBLEM = 'RDDL/Thiagos_HVAC.rddl'
-FOLDER = 'Competition/Power_gen/'
+# FOLDER = 'Competition/Power_gen/'
 # FOLDER = 'Competition/Mars_rover/'
-# FOLDER = 'Competition/drone_con/'
+FOLDER = 'Competition/UAVs_mix/'
 # FOLDER = 'Competition/MountainCar/'
 # FOLDER = 'Competition/Cartpole/'
 # FOLDER = 'Competition/Recsim/'
 
+
 def main():
     myEnv = RDDLEnv.RDDLEnv(domain=FOLDER+'domain.rddl', instance=FOLDER+'instance0.rddl', is_grounded=False)
     agent = RandomAgent(action_space=myEnv.action_space, num_actions=myEnv.NumConcurrentActions)
+    # myEnv.set_visualizer(MarsRoverVisualizer)
 
     total_reward = 0
     state = myEnv.reset()
     for step in range(myEnv.horizon):
-        myEnv.render()
+        # myEnv.render()
         action = agent.sample_action()
         next_state, reward, done, info = myEnv.step(action)
         total_reward += reward
diff --git a/unit_test_mars_rover.py b/unit_test_mars_rover.py
index 4d0d7adc..6805371e 100644
--- a/unit_test_mars_rover.py
+++ b/unit_test_mars_rover.py
@@ -3,6 +3,7 @@
 import numpy as np
 import random
 import math
+from copy import copy
 
 FOLDER = 'Competition/Mars_rover/'
 
@@ -43,14 +44,15 @@ def mars_rover_update(state, action):
     new_pos_x_d2 = state['pos_x_d2'] + 0.1 * state['vel_x_d2']
     new_pos_y_d2 = state['pos_y_d2'] + 0.1 * state['vel_y_d2']
     
-    is_within1 = math.sqrt((state['pos_x_d1'] - 5) ** 2 + (state['pos_y_d1'] - 5) ** 2) < 1
-    is_within2 = math.sqrt((state['pos_x_d1'] - -5) ** 2 + (state['pos_y_d1'] - -5) ** 2) < 1
+    print(action)
     new_mineral_harvested_m1 = state['mineral_harvested_m1'] or (
         (math.sqrt((state['pos_x_d1'] - 5) ** 2 + (state['pos_y_d1'] - 5) ** 2) < 6 and action['harvest_d1'])
-        or (math.sqrt((state['pos_x_d2'] - 5) ** 2 + (state['pos_y_d2'] - 5) ** 2) < 6 and action['harvest_d2']))
+        or (math.sqrt((state['pos_x_d2'] - 5) ** 2 + (state['pos_y_d2'] - 5) ** 2) < 6 and action['harvest_d2'])
+    )
     new_mineral_harvested_m2 = state['mineral_harvested_m2'] or (
-        (math.sqrt((state['pos_x_d1'] - -8) ** 2 + (state['pos_y_d1'] - -8) ** 2) < 6 and action['harvest_d1'])
-        or (math.sqrt((state['pos_x_d2'] - -8) ** 2 + (state['pos_y_d2'] - -8) ** 2) < 8 and action['harvest_d2']))
+        (math.sqrt((state['pos_x_d1'] - (-8)) ** 2 + (state['pos_y_d1'] - (-8)) ** 2) < 8 and action['harvest_d1'])
+        or (math.sqrt((state['pos_x_d2'] - (-8)) ** 2 + (state['pos_y_d2'] - (-8)) ** 2) < 8 and action['harvest_d2'])
+    )
 
     next_state = {'vel_x_d1': new_vel_x_d1,
                   'vel_y_d1': new_vel_y_d1,
@@ -63,29 +65,51 @@ def mars_rover_update(state, action):
                   'mineral_harvested_m1': new_mineral_harvested_m1,
                   'mineral_harvested_m2': new_mineral_harvested_m2}
     
-    reward = -(u_x_d1 **2 + u_y_d1 ** 2) + -(u_x_d2 **2 + u_y_d2 ** 2) + \
-        (8 if ((math.sqrt((state['pos_x_d1'] - 5) ** 2 + (state['pos_y_d1'] - 5) ** 2) < 6 and action['harvest_d1'])
-        or (math.sqrt((state['pos_x_d2'] - 5) ** 2 + (state['pos_y_d2'] - 5) ** 2) < 6 and action['harvest_d2'])) else 0) \
-        + (5 if ((math.sqrt((state['pos_x_d1'] - -8) ** 2 + (state['pos_y_d1'] - -8) ** 2) < 6 and action['harvest_d1'])
-        or (math.sqrt((state['pos_x_d2'] - -8) ** 2 + (state['pos_y_d2'] - -8) ** 2) < 8 and action['harvest_d2'])) else 0) \
-        - 1. * action['harvest_d1'] - 1. * action['harvest_d2']
+    mineral_m1_cond = (
+        8 if (
+            (math.sqrt((state['pos_x_d1'] - 5) ** 2 + (state['pos_y_d1'] - 5) ** 2) < 6 and action['harvest_d1'])
+            or (math.sqrt((state['pos_x_d2'] - 5) ** 2 + (state['pos_y_d2'] - 5) ** 2) < 6 and action['harvest_d2'])
+        ) 
+        else 0
+    )
+    
+    mineral_m2_cond = (
+        5 if (
+            (math.sqrt((state['pos_x_d1'] - -8) ** 2 + (state['pos_y_d1'] - -8) ** 2) < 8 and action['harvest_d1'])
+            or (math.sqrt((state['pos_x_d2'] - -8) ** 2 + (state['pos_y_d2'] - -8) ** 2) < 8 and action['harvest_d2'])
+        ) 
+        else 0
+    )
+    
+    reward = -(u_x_d1 **2 + u_y_d1 ** 2) - (u_x_d2 **2 + u_y_d2 ** 2) + \
+            mineral_m1_cond + mineral_m2_cond \
+            - 1. * action['harvest_d1'] - 1. * action['harvest_d2']
     return reward, next_state, next_derived
 
-
+def myprintstate(next_test_state, next_state):
+    for key in sorted(next_test_state.keys()):
+        print('key = {}, test = {}, rddl = {}, pass = {}'.format(
+            key, next_test_state[key], next_state[key], next_test_state[key] == next_state[key]))
+    
 def main():
     myEnv = RDDLEnv.RDDLEnv(domain=FOLDER + 'domain.rddl', instance=FOLDER + 'instance0.rddl', is_grounded=False)
     agent = RandomAgent(action_space=myEnv.action_space, num_actions=myEnv.NumConcurrentActions)
     
     from pprint import pprint
     pprint(vars(myEnv.model))
+    # print(myEnv.model.reward)
     
+    print(myEnv.model.cpfs['mineral_harvested_m1\''])
+    print(myEnv.model.cpfs['mineral_harvested_m2\''])
     total_reward = 0
     state = myEnv.reset()
     test_state = state
+    print(state)
     for step in range(myEnv.model.horizon):
         myEnv.render()
         action = agent.sample_action()
-
+        action['harvest_d1'] = bool(action['harvest_d1'])
+        action['harvest_d2'] = bool(action['harvest_d2'])
         next_state, reward, done, info = myEnv.step(action)
         total_reward += reward
         print("\nstep = {}".format(step))
@@ -98,9 +122,10 @@ def main():
         
         test_reward, next_test_state, test_derived = mars_rover_update(
             test_state, action)
-        assert test_reward == reward
-        assert next_test_state == next_state
+        print(test_reward)
+        assert next_test_state == next_state, myprintstate(next_test_state, next_state)
         assert test_derived == myEnv.model.derived
+        assert test_reward == reward
         test_state = next_test_state
         
     print("episode ended with reward {}".format(total_reward))
diff --git a/unit_test_power_gen.py b/unit_test_power_gen.py
index ca80e8bd..e2ba84fc 100644
--- a/unit_test_power_gen.py
+++ b/unit_test_power_gen.py
@@ -9,9 +9,9 @@
 
 
 def power_gen_update(state, action):
-    prod_p1 = max(min(action['curProd_p1'], 10), 0)
-    prod_p2 = max(min(action['curProd_p2'], 10), 0)
-    prod_p3 = max(min(action['curProd_p3'], 10), 0)
+    prod_p1 = max(min(action['curProd_p1'], 10), 3)
+    prod_p2 = max(min(action['curProd_p2'], 10), 3)
+    prod_p3 = max(min(action['curProd_p3'], 10), 3)
     next_prevProd_p1 = prod_p1
     next_prevProd_p2 = prod_p2
     next_prevProd_p3 = prod_p3
@@ -23,22 +23,29 @@ def power_gen_update(state, action):
     reward = -(prod_p1 * 5 + prod_p2 * 5 + prod_p3 * 5) + (fulfilledDemand * 8) \
              -(1000. if (demand > fulfilledDemand) else 0.) \
              +(abs(prod_p1 - state['prevProd_p1']) * 1 + abs(prod_p2 - state['prevProd_p2']) * 1 \
-               + abs(prod_p3 - state['prevProd_p3']) * 1);
+               +abs(prod_p3 - state['prevProd_p3']) * 1);
     
-    next_derived = {'prod_p1' : prod_p1,
-                    'prod_p2' : prod_p2,
-                    'prod_p3' : prod_p3,
-                    'demand' : demand}
+    next_derived = {'prod_p1': prod_p1,
+                    'prod_p2': prod_p2,
+                    'prod_p3': prod_p3,
+                    'demand': demand}
     
-    next_interm = {'fulfilledDemand' : fulfilledDemand}
+    next_interm = {'fulfilledDemand': fulfilledDemand}
     
-    next_state = {'prevProd_p1' : next_prevProd_p1,
-                  'prevProd_p2' : next_prevProd_p2,
-                  'prevProd_p3' : next_prevProd_p3,
-                  'temperature' : next_temperature}
+    next_state = {'prevProd_p1': next_prevProd_p1,
+                  'prevProd_p2': next_prevProd_p2,
+                  'prevProd_p3': next_prevProd_p3,
+                  'temperature': next_temperature}
     
     return reward, next_state, next_derived, next_interm
 
+
+def myprintstate(next_test_state, next_state):
+    for key in sorted(next_test_state.keys()):
+        print('key = {}, test = {}, rddl = {}, pass = {}'.format(
+            key, next_test_state[key], next_state[key], next_test_state[key] == next_state[key]))
+
+    
 def main():
     myEnv = RDDLEnv.RDDLEnv(domain=FOLDER + 'domain.rddl', instance=FOLDER + 'instance0.rddl', is_grounded=False)
     agent = RandomAgent(action_space=myEnv.action_space, num_actions=myEnv.NumConcurrentActions)
@@ -46,6 +53,9 @@ def main():
     
     from pprint import pprint
     pprint(vars(myEnv.model))
+    for key in myEnv.model.cpfs.keys():
+        print('\n' + key)
+        print(myEnv.model.cpfs[key])
     
     total_reward = 0
     state = myEnv.reset()
@@ -67,13 +77,14 @@ def main():
         
         test_reward, next_test_state, test_derived, test_interm = power_gen_update(
             test_state, action)
+        print('reward = {}'.format(test_reward))
         print('next_state = {}'.format(next_test_state))
         print('derived = {}'.format(test_derived))
         print('interm = {}'.format(test_interm))
+        assert next_test_state == next_state, myprintstate(next_test_state, next_state)
+        assert test_derived == myEnv.model.derived, myprintstate(test_derived, myEnv.model.derived)
+        assert test_interm == myEnv.model.interm, myprintstate(test_interm, myEnv.model.interm)
         assert test_reward == reward
-        assert next_test_state == next_state
-        assert test_derived == myEnv.model.derived
-        assert test_interm == myEnv.model.interm
         test_state = next_test_state
         
     print("episode ended with reward {}".format(total_reward))