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

Issue:
renaming of instances



Discussion / hints:

Fix patch:
diff --git a/Competition/Cartpole/domain.rddl b/Competition/Cartpole/domain.rddl
new file mode 100644
index 00000000..344beb29
--- /dev/null
+++ b/Competition/Cartpole/domain.rddl
@@ -0,0 +1,93 @@
+////////////////////////////////////////////////////////////////////
+// A simple continuous MDP for the classical cart-pole system by Rich
+// Sutton. 
+//
+// The goal here is to push a cart on a flat and frictionless surface 
+// left or right by applying a constant force, in order to balance a 
+// pole balanced vertically in the center of the cart.
+//
+////////////////////////////////////////////////////////////////////
+domain cart_pole {
+
+    requirements = {
+        reward-deterministic
+    };
+
+    pvariables {
+
+    	// 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
+
+		// 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
+		
+		// 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
+	
+		// 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
+		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
+       	vel   	: { state-fluent, real, default = 0 };          // cart 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
+    };
+
+    cpfs {
+		// the actual signed force on the cart
+		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))));
+		
+		// compute the cart acceleration
+		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);
+		
+		// if out of bounds, do not update the state
+		increment = if(out_of_bounds)
+						then 0.0
+						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];
+		vel' = vel + increment * 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)
+				then 0.0
+				else 1.0;
+
+    state-invariants {
+		pos >= -POS_LIMIT ^ pos <= POS_LIMIT;
+		ang_pos >= -ANG_LIMIT ^ ang_pos <= ANG_LIMIT;
+    };
+
+    action-preconditions {
+		(force_side == 0) | (force_side == 1);
+    };
+
+}
diff --git a/Competition/Cartpole/instance0.rddl b/Competition/Cartpole/instance0.rddl
new file mode 100644
index 00000000..693a1435
--- /dev/null
+++ b/Competition/Cartpole/instance0.rddl
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////
+// A simple continuous MDP for the classical cart-pole system by Rich
+// Sutton. 
+//
+// The goal here is to push a cart on a flat and frictionless surface 
+// left or right by applying a constant force, in order to balance a 
+// pole balanced vertically in the center of the cart.
+//
+////////////////////////////////////////////////////////////////////
+
+non-fluents cart_pole_vars {
+    domain = cart_pole;
+}
+
+// Specify cart pole with default settings
+instance inst_cart_pole {
+
+	domain = cart_pole;
+
+	non-fluents = cart_pole_vars;
+
+	init-state {
+	    pos = 0.0;
+        vel = 0.0;
+        ang_pos = 0.0;
+        ang_vel = 0.0;
+	};
+
+  	// State-action constraints above are sufficient
+	max-nondef-actions = pos-inf;
+
+	horizon  = 200;
+	discount = 1.0;
+}
+
diff --git a/Competition/Drone_con/domain.rddl b/Competition/Drone_con/domain.rddl
new file mode 100644
index 00000000..9d4d08d5
--- /dev/null
+++ b/Competition/Drone_con/domain.rddl
@@ -0,0 +1,118 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// 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
new file mode 100644
index 00000000..f4a10ea4
--- /dev/null
+++ b/Competition/Drone_con/domain_old.rddl
@@ -0,0 +1,103 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// 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
new file mode 100644
index 00000000..f677bf0f
--- /dev/null
+++ b/Competition/Drone_con/instance0.rddl
@@ -0,0 +1,60 @@
+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
new file mode 100644
index 00000000..fc166832
--- /dev/null
+++ b/Competition/Drone_con/instance1.rddl
@@ -0,0 +1,60 @@
+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
new file mode 100644
index 00000000..413ae389
--- /dev/null
+++ b/Competition/Drone_dis/domain.rddl
@@ -0,0 +1,117 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// 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
new file mode 100644
index 00000000..5469e500
--- /dev/null
+++ b/Competition/Drone_dis/domain_old.rddl
@@ -0,0 +1,103 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// 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
new file mode 100644
index 00000000..841a14e9
--- /dev/null
+++ b/Competition/Drone_dis/instance0.rddl
@@ -0,0 +1,52 @@
+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
new file mode 100644
index 00000000..e143599a
--- /dev/null
+++ b/Competition/Drone_mix/domain.rddl
@@ -0,0 +1,118 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// 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
new file mode 100644
index 00000000..9f20dd80
--- /dev/null
+++ b/Competition/Drone_mix/domain_old.rddl
@@ -0,0 +1,104 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+// 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
new file mode 100644
index 00000000..6f633604
--- /dev/null
+++ b/Competition/Drone_mix/instance0.rddl
@@ -0,0 +1,52 @@
+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/MountainCar/domain.rddl b/Competition/MountainCar/domain.rddl
new file mode 100644
index 00000000..f1c7927c
--- /dev/null
+++ b/Competition/MountainCar/domain.rddl
@@ -0,0 +1,65 @@
+////////////////////////////////////////////////////////////////////
+// A simple continuous MDP for the classical mountain car control
+// problem. A car is placed at the bottom of a valley, and must be
+// brought to a destination located at the top of a hill by pushing
+// the car left and right. 
+////////////////////////////////////////////////////////////////////
+domain mountain_car {
+
+    requirements = {
+        reward-deterministic
+    };
+
+    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
+
+		// 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
+		
+		// interm & derived fluents
+		success : { derived-fluent, bool };                       	// whether the cart reached its goal
+				
+		// states
+       	pos    	: { state-fluent, real, default = -0.5 };          	// cart position
+       	vel   	: { state-fluent, real, default = 0 };          	// cart velocity
+
+       	// actions
+       	action : { action-fluent, int, default = 1 };      			// whether to accelerate left (0), none (1) or right (2)
+    };
+
+    cpfs {
+		// check if we reached the goal
+		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];		
+    };
+
+    // R = 1 as long as the pole is upright and the cart is not out of bounds
+    reward = if(success)
+				then 1.0
+				else 0.0;
+
+    state-invariants {
+		pos >= MIN_POS ^ pos <= MAX_POS;
+		vel >= -MAX_VEL ^ vel <= MAX_VEL;
+    };
+
+    action-preconditions {
+		(action == 0) | (action == 1) | (action == 2);
+    };
+
+}
diff --git a/Competition/MountainCar/instance0.rddl b/Competition/MountainCar/instance0.rddl
new file mode 100644
index 00000000..7ef4ad82
--- /dev/null
+++ b/Competition/MountainCar/instance0.rddl
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////
+// A simple continuous MDP for the classical mountain car control
+// problem. A car is placed at the bottom of a valley, and must be
+// brought to a destination located at the top of a hill by pushing
+// the car left and right. 
+////////////////////////////////////////////////////////////////////
+non-fluents mountain_car_vars {
+    domain = mountain_car;
+}
+
+// Specify cart pole with default settings
+instance inst_mountain_car {
+
+	domain = mountain_car;
+
+	non-fluents = mountain_car_vars;
+
+	init-state {
+	    pos = -0.5;
+        vel = 0.0;
+	};
+
+  	// State-action constraints above are sufficient
+	max-nondef-actions = pos-inf;
+
+	horizon  = 200;
+	discount = 1.0;
+}
+
diff --git a/Competition/Power_gen/instance0.rddl b/Competition/Power_gen/instance0.rddl
index 5dd325b8..ab44daec 100644
--- a/Competition/Power_gen/instance0.rddl
+++ b/Competition/Power_gen/instance0.rddl
@@ -44,9 +44,6 @@ instance inst_power_gen {
 	init-state { 
 		temperature = 10;
 		prevProd(p1) = 5;
-		prevProd(p1) = 7;
-		prevProd(p1) = 9;
-
 	};
   
   	// State-action constraints above are sufficient
diff --git a/Env/RDDLEnv.py b/Env/RDDLEnv.py
index 917eb02f..686c6b8b 100644
--- a/Env/RDDLEnv.py
+++ b/Env/RDDLEnv.py
@@ -193,35 +193,6 @@ def render(self):
             pygameSurface = self.pilImageToSurface(image)
             self.window.blit(pygameSurface, (0, 0))
             pygame.display.flip()
-<<<<<<< HEAD
-        return image
-            # return image
-            # this_images = pygame.image.fromstring(image.data, image.size, image.mode)
-
-            # self.window.geometry('%dx%d' % (image.size[0], image.size[1]))
-            # tkpi = ImageTk.PhotoImage(image)
-            # label_image = tkinter.Label(self.window, image=tkpi)
-            # label_image.pack()
-            # label_image.place(x=0, y=0, width=image.size[0], height=image.size[1])
-            # self.window.title("title")
-            # self.window.mainloop()
-            # if self.image is not None:
-            #     self.image.destroy()
-            # self.image = label_image
-
-
-
-            # if self.image is not None:
-            #     plt.close()
-                # self.image.close()
-            # self.image = self._visualizer.render(self.state)
-            # plt.close()
-            # plt.imshow(self.image)
-            # plt.show()
-            # self.image.show()
-            # self.image.close()
-=======
->>>>>>> 0222ff43787b68e856dece15dbd4de3f5d3075b4
 
 
     @property
diff --git a/Grounder/RDDLGrounder.py b/Grounder/RDDLGrounder.py
index 7265cca3..1dc4f6da 100644
--- a/Grounder/RDDLGrounder.py
+++ b/Grounder/RDDLGrounder.py
@@ -132,7 +132,7 @@ def _ground_discount(self):
         return discount
 
     def _extract_objects(self):
-        if self.AST.non_fluents.objects[0] is None:
+        if (not self.AST.non_fluents.objects) or self.AST.non_fluents.objects[0] is None:
             self.objects = None
             self.objects_rev = None
         else:
diff --git a/Visualizer/CartPoleViz.py b/Visualizer/CartPoleViz.py
new file mode 100644
index 00000000..ef9c1006
--- /dev/null
+++ b/Visualizer/CartPoleViz.py
@@ -0,0 +1,79 @@
+import numpy as np
+from PIL import Image
+import pygame
+from pygame import gfxdraw
+
+from Grounder.RDDLModel import RDDLModel
+from Visualizer.StateViz import StateViz
+
+
+# code comes from openai gym
+class CartPoleVisualizer(StateViz):
+
+    def __init__(self, model: RDDLModel, figure_size=[600, 400]) -> None:
+        self._model = model
+        self._figure_size = figure_size
+        
+        self._nonfluents = model.nonfluents
+    
+    def init_canvas(self, figure_size):
+        screen = pygame.Surface(figure_size)
+        surf = pygame.Surface(figure_size)
+        return screen, surf
+        
+    def convert2img(self, screen):
+        data = np.transpose(np.array(pygame.surfarray.pixels3d(screen)), axes=(1, 0, 2))
+        img = Image.fromarray(data)
+        return img
+    
+    def render(self, state):
+        screen, surf = self.init_canvas(self._figure_size)
+        
+        world_width = self._nonfluents['POS_LIMIT'] * 2
+        scale = self._figure_size[0] / world_width
+        polewidth = 10.0
+        polelen = scale * (2 * self._nonfluents['POLE_LEN'])
+        cartwidth = 50.0
+        cartheight = 30.0
+        l, r, t, b = -cartwidth / 2, cartwidth / 2, cartheight / 2, -cartheight / 2
+        axleoffset = cartheight / 4.0
+        
+        surf.fill((255, 255, 255))
+        cartx = state['pos'] * scale + self._figure_size[0] / 2.0  # MIDDLE OF CART
+        carty = 100  # TOP OF CART
+        cart_coords = [(l, b), (l, t), (r, t), (r, b)]
+        cart_coords = [(c[0] + cartx, c[1] + carty) for c in cart_coords]
+        gfxdraw.aapolygon(surf, cart_coords, (0, 0, 0))
+        gfxdraw.filled_polygon(surf, cart_coords, (0, 0, 0))
+        
+        l, r, t, b = -polewidth / 2, polewidth / 2, polelen - polewidth / 2, -polewidth / 2
+        pole_coords = []
+        for coord in [(l, b), (l, t), (r, t), (r, b)]:
+            coord = pygame.math.Vector2(coord).rotate_rad(-state['ang_pos'])
+            coord = (coord[0] + cartx, coord[1] + carty + axleoffset)
+            pole_coords.append(coord)
+        gfxdraw.aapolygon(surf, pole_coords, (202, 152, 101))
+        gfxdraw.filled_polygon(surf, pole_coords, (202, 152, 101))
+         
+        gfxdraw.aacircle(
+            surf,
+            int(cartx),
+            int(carty + axleoffset),
+            int(polewidth / 2),
+            (129, 132, 203),
+        )
+        gfxdraw.filled_circle(
+            surf,
+            int(cartx),
+            int(carty + axleoffset),
+            int(polewidth / 2),
+            (129, 132, 203),
+        )
+        gfxdraw.hline(surf, 0, self._figure_size[0], carty, (0, 0, 0))
+
+        surf = pygame.transform.flip(surf, False, True)
+        screen.blit(surf, (0, 0))
+        
+        img = self.convert2img(screen)
+        return img
+    
diff --git a/Visualizer/MountainCarViz.py b/Visualizer/MountainCarViz.py
new file mode 100644
index 00000000..24ed53c4
--- /dev/null
+++ b/Visualizer/MountainCarViz.py
@@ -0,0 +1,93 @@
+import math
+import numpy as np
+from PIL import Image
+import pygame
+from pygame import gfxdraw
+
+from Grounder.RDDLModel import RDDLModel
+from Visualizer.StateViz import StateViz
+
+
+# code comes from openai gym
+class MountainCarVisualizer(StateViz):
+
+    def __init__(self, model: RDDLModel, figure_size=[600, 400]) -> None:
+        self._model = model
+        self._figure_size = figure_size
+        
+        self._nonfluents = model.nonfluents
+    
+    def init_canvas(self, figure_size):
+        screen = pygame.Surface(figure_size)
+        surf = pygame.Surface(figure_size)
+        return screen, surf
+        
+    def convert2img(self, screen):
+        data = np.transpose(np.array(pygame.surfarray.pixels3d(screen)), axes=(1, 0, 2))
+        img = Image.fromarray(data)
+        return img
+    
+    def render(self, state):
+        screen, surf = self.init_canvas(self._figure_size)
+        
+        world_width = self._nonfluents['MAX_POS'] - self._nonfluents['MIN_POS']
+        scale = self._figure_size[0] / world_width
+        carwidth = 40
+        carheight = 20
+        
+        surf.fill((255, 255, 255))
+        xs = np.linspace(self._nonfluents['MIN_POS'], self._nonfluents['MAX_POS'], 100)
+        ys = np.sin(3 * xs) * self._nonfluents['DEPTH'] + (1. - self._nonfluents['DEPTH'])
+        xys = list(zip((xs - self._nonfluents['MIN_POS']) * scale, ys * scale))
+        pygame.draw.aalines(surf, points=xys, closed=False, color=(0, 0, 0))
+        
+        clearance = 10
+        l, r, t, b = -carwidth / 2, carwidth / 2, carheight, 0
+        coords = []
+        for c in [(l, b), (l, t), (r, t), (r, b)]:
+            c = pygame.math.Vector2(c).rotate_rad(math.cos(3 * state['pos']))
+            coords.append(
+                (
+                    c[0] + (state['pos'] - self._nonfluents['MIN_POS']) * scale,
+                    c[1] + clearance + (np.sin(3 * state['pos']) * self._nonfluents['DEPTH'] + (1. - self._nonfluents['DEPTH'])) * scale,
+                )
+            )
+
+        gfxdraw.aapolygon(surf, coords, (0, 0, 0))
+        gfxdraw.filled_polygon(surf, coords, (0, 0, 0))
+        
+        for c in [(carwidth / 4, 0), (-carwidth / 4, 0)]:
+            c = pygame.math.Vector2(c).rotate_rad(math.cos(3 * state['pos']))
+            wheel = (
+                int(c[0] + (state['pos'] - self._nonfluents['MIN_POS']) * scale),
+                int(c[1] + clearance + (np.sin(3 * state['pos']) * self._nonfluents['DEPTH'] + (1. - self._nonfluents['DEPTH'])) * scale),
+            )
+            gfxdraw.aacircle(
+                surf, wheel[0], wheel[1], int(carheight / 2.5), (128, 128, 128)
+            )
+            gfxdraw.filled_circle(
+                surf, wheel[0], wheel[1], int(carheight / 2.5), (128, 128, 128)
+            )
+            
+        flagx = int((self._nonfluents['GOAL_MIN'] - self._nonfluents['MIN_POS']) * scale)
+        flagy1 = int((np.sin(3 * self._nonfluents['GOAL_MIN']) * self._nonfluents['DEPTH'] + (1. - self._nonfluents['DEPTH'])) * scale)
+        flagy2 = flagy1 + 50
+        gfxdraw.vline(surf, flagx, flagy1, flagy2, (0, 0, 0))
+        
+        gfxdraw.aapolygon(
+            surf,
+            [(flagx, flagy2), (flagx, flagy2 - 10), (flagx + 25, flagy2 - 5)],
+            (204, 204, 0),
+        )
+        gfxdraw.filled_polygon(
+            surf,
+            [(flagx, flagy2), (flagx, flagy2 - 10), (flagx + 25, flagy2 - 5)],
+            (204, 204, 0),
+        )
+        
+        surf = pygame.transform.flip(surf, False, True)
+        screen.blit(surf, (0, 0))
+
+        img = self.convert2img(screen)
+        return img
+    
diff --git a/_deprecated.py b/_deprecated.py
index 351ce24b..4af92316 100644
--- a/_deprecated.py
+++ b/_deprecated.py
@@ -1,3 +1,250 @@
+# 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 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()
+
+
+
+# GROUNDER OLD
 # class RDDLGroundedGrounder(Grounder):
 #
 #   def __init__(self, RDDL_AST):


Test patch:
diff --git a/test.py b/test.py
deleted file mode 100644
index edc74bc9..00000000
--- a/test.py
+++ /dev/null
@@ -1,243 +0,0 @@
-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 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()
-
diff --git a/testGym.py b/testGym.py
index 5788ec1d..7bd49bcb 100644
--- a/testGym.py
+++ b/testGym.py
@@ -5,12 +5,13 @@
 # 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_mix/'
+FOLDER = 'Competition/drone_con/'
+# FOLDER = 'Competition/MountainCar/'
 
 def main():
-    myEnv = RDDLEnv.RDDLEnv(domain=FOLDER+'domain.rddl', instance=FOLDER+'instance0.rddl', is_grounded=False)
+    myEnv = RDDLEnv.RDDLEnv(domain=FOLDER+'domain.rddl', instance=FOLDER+'insta0.rddl', is_grounded=False)
     agent = RandomAgent(action_space=myEnv.action_space, num_actions=myEnv.NumConcurrentActions)
 
     total_reward = 0
diff --git a/testGymDrone.py b/testGymDrone.py
index d8854ac8..d95bc6bd 100644
--- a/testGymDrone.py
+++ b/testGymDrone.py
@@ -10,10 +10,10 @@ def main():
     steps = 1000
     myEnv = RDDLEnv.RDDLEnv(domain=FOLDER + 'domain.rddl', instance=FOLDER + 'insta0.rddl', is_grounded=False)
     agent = RandomAgent(action_space=myEnv.action_space, num_actions=myEnv.NumConcurrentActions)
-    
+
     from pprint import pprint
     pprint(vars(myEnv.model))
-    
+
     total_reward = 0
     state = myEnv.reset()
     for step in range(steps):
diff --git a/testGymMike.py b/test_basic.py
similarity index 93%
rename from testGymMike.py
rename to test_basic.py
index c7c962fd..456f3262 100644
--- a/testGymMike.py
+++ b/test_basic.py
@@ -3,11 +3,10 @@
 import numpy as np
 import random
 
-FOLDER = 'Competition/Drone_mix/'
+FOLDER = 'Competition/MountainCar/'
 
 
 def main():
-    steps = 30
     myEnv = RDDLEnv.RDDLEnv(domain=FOLDER + 'domain.rddl', instance=FOLDER + 'insta0.rddl', is_grounded=False)
     agent = RandomAgent(action_space=myEnv.action_space, num_actions=myEnv.NumConcurrentActions)
     
@@ -16,7 +15,7 @@ def main():
     
     total_reward = 0
     state = myEnv.reset()
-    for step in range(steps):
+    for step in range(myEnv.model.horizon):
         myEnv.render()
         action = agent.sample_action()
 
diff --git a/unit_test_mars_rover.py b/unit_test_mars_rover.py
index 354ed534..8a3b6e3c 100644
--- a/unit_test_mars_rover.py
+++ b/unit_test_mars_rover.py
@@ -46,7 +46,6 @@ def mars_rover_update(state, action):
 
 
 def main():
-    steps = 30
     myEnv = RDDLEnv.RDDLEnv(domain=FOLDER + 'domain.rddl', instance=FOLDER + 'insta0.rddl', is_grounded=False)
     agent = RandomAgent(action_space=myEnv.action_space, num_actions=myEnv.NumConcurrentActions)
     
@@ -56,7 +55,7 @@ def main():
     total_reward = 0
     state = myEnv.reset()
     test_state = state
-    for step in range(steps):
+    for step in range(myEnv.model.horizon):
         myEnv.render()
         action = agent.sample_action()
 
diff --git a/unit_test_power_gen.py b/unit_test_power_gen.py
index a7a1ca55..c5ac8900 100644
--- a/unit_test_power_gen.py
+++ b/unit_test_power_gen.py
@@ -40,7 +40,6 @@ def power_gen_update(state, action):
     return reward, next_state, next_derived, next_interm
 
 def main():
-    steps = 30
     myEnv = RDDLEnv.RDDLEnv(domain=FOLDER + 'domain.rddl', instance=FOLDER + 'insta0.rddl', is_grounded=False)
     agent = RandomAgent(action_space=myEnv.action_space, num_actions=myEnv.NumConcurrentActions)
     myEnv.model.nonfluents['TEMP_VARIANCE'] = 0.
@@ -51,7 +50,7 @@ def main():
     total_reward = 0
     state = myEnv.reset()
     test_state = state
-    for step in range(steps):
+    for step in range(myEnv.model.horizon):
         myEnv.render()
         action = agent.sample_action()