Index: cpp/frams/genetics/fS/fS_general.h
===================================================================
--- cpp/frams/genetics/fS/fS_general.h	(revision 958)
+++ cpp/frams/genetics/fS/fS_general.h	(revision 969)
@@ -14,16 +14,9 @@
 #include "frams/util/multirange.h"
 
-/** @name Names of genotype modes */
-//@{
-#define MODIFIER_MODE 'M'
-#define PARAM_MODE 'S'
-#define CYCLE_MODE 'J'
-//@}
-
 /** @name Values of constants used in encoding */
 //@{
 #define BRANCH_START '('
 #define BRANCH_END ')'
-#define BRANCH_SEPARATOR ','
+#define BRANCH_SEPARATOR '^'
 #define PARAM_START '{'
 #define PARAM_END '}'
@@ -45,7 +38,4 @@
 /** @name Every modifier changes the underlying value by this multiplier */
 const double MODIFIER_MULTIPLIER = 1.1;
-/** @name In mutation parameters will be multiplied by at most this value */
-const double PARAM_MAX_MULTIPLIER = 1.5;
-
 /**
  * Used in finding the proper distance between the parts
@@ -70,4 +60,5 @@
 #define INGESTION "i"
 #define FRICTION "f"
+#define STIFFNESS "st"
 #define SIZE "s"
 #define SIZE_X "x"
@@ -80,5 +71,4 @@
 #define RY "ry"
 #define RZ "rz"
-#define JOINT_DISTANCE "j"
 //@}
 /** @name Macros and values used in collision detection */
@@ -113,15 +103,23 @@
 const char DEFAULT_JOINT = 'a';
 const string JOINTS = "bc";
+const string ALL_JOINTS = "abc";
 const int JOINT_COUNT = JOINTS.length();
-const string MODIFIERS = "IFS";
+const string MODIFIERS = "IFST";
 const char SIZE_MODIFIER = 's';
 const vector<string> PARAMS {INGESTION, FRICTION, ROT_X, ROT_Y, ROT_Z, RX, RY, RZ, SIZE, SIZE_X, SIZE_Y, SIZE_Z,
-							  JOINT_DISTANCE};
+							 STIFFNESS};
 
 /** @name Default values of node parameters*/
 static const Part defPart = Model::getDefPart();
-const std::map<string, double> defaultParamValues = {
+static const Joint defJoint = Model::getDefJoint();
+const std::map<Part::Shape, double> volumeMultipliers = {
+		{Part::Shape::SHAPE_CUBOID, 8.0},
+		{Part::Shape::SHAPE_CYLINDER, 2.0 * M_PI},
+		{Part::Shape::SHAPE_ELLIPSOID, (4.0 / 3.0) * M_PI},
+};
+const std::map<string, double> defaultValues = {
 		{INGESTION,      defPart.ingest},
 		{FRICTION,       defPart.friction},
+		{STIFFNESS,	 	 defJoint.stif},
 		{ROT_X,          0.0},
 		{ROT_Y,          0.0},
@@ -133,6 +131,37 @@
 		{SIZE_X,         1.0},
 		{SIZE_Y,         1.0},
-		{SIZE_Z,         1.0},
-		{JOINT_DISTANCE, 1.0}
+		{SIZE_Z,         1.0}
+};
+
+const std::map<string, double> minValues = {
+		{INGESTION,      0},
+		{FRICTION,       0},
+		{STIFFNESS,	 0.0},
+		{ROT_X,          -M_PI},
+		{ROT_Y,          -M_PI},
+		{ROT_Z,          -M_PI},
+		{RX,             -M_PI},
+		{RY,             -M_PI},
+		{RZ,             -M_PI},
+		{SIZE,           0.01},
+		{SIZE_X,         0.01},
+		{SIZE_Y,         0.01},
+		{SIZE_Z,         0.01}
+};
+
+const std::map<string, double> maxValues = {
+		{INGESTION,      1.0},
+		{FRICTION,       1.0},
+		{STIFFNESS,	 0.0},
+		{ROT_X,          M_PI},
+		{ROT_Y,          M_PI},
+		{ROT_Z,          M_PI},
+		{RX,             M_PI},
+		{RY,             M_PI},
+		{RZ,             M_PI},
+		{SIZE,           100.0},
+		{SIZE_X,         100.0},
+		{SIZE_Y,         100.0},
+		{SIZE_Z,         100.0}
 };
 
@@ -252,4 +281,5 @@
 	double ing = 1.0;      /// Ingestion multiplier
 	double s = 1.0;      /// Size multipliers
+	double stif = 1.0;	/// Stiffness multipliers
 
 	State(State *_state); /// Derive the state from parent
@@ -301,5 +331,4 @@
 private:
 	Substring *partDescription = nullptr;
-	bool cycleMode, modifierMode, paramMode; /// Possible modes
 	Node *parent;
 	Part *part;     /// A part object built from node. Used in building the Model
@@ -309,26 +338,7 @@
 	vector<Node *> children;    /// Vector of all direct children
 	std::map<char, int> modifiers;     /// Vector of all modifiers
-	char joint = DEFAULT_JOINT;           /// Set of all joints
 	vector<fS_Neuron *> neurons;    /// Vector of all the neurons
 
-	static double calculateRadiusFromVolume(Part::Shape partType, double volume)
-	{
-		double result;
-		switch (partType)
-		{
-			case Part::Shape::SHAPE_CUBOID:
-				result = std::cbrt(volume / 8.0);
-				break;
-			case Part::Shape::SHAPE_CYLINDER:
-				result = std::cbrt(volume / (2.0 * M_PI));
-				break;
-			case Part::Shape::SHAPE_ELLIPSOID:
-				result = std::cbrt(volume / ((4.0 / 3.0) * M_PI));
-				break;
-			default:
-				logMessage("fS", "calculateVolume", LOG_ERROR, "Invalid part type");
-		}
-		return result;
-	}
+	double getDistance();
 
 	void cleanUp();
@@ -384,5 +394,5 @@
 	 * @param _state state of the parent
 	 */
-	void getState(State *_state, const Pt3D &parentSize);
+	void getState(State *_state);
 
 	/**
@@ -419,8 +429,9 @@
 
 public:
+	char joint = DEFAULT_JOINT;           /// Set of all joints
 	Part::Shape partType;  /// The type of the part
 	State *state = nullptr; /// The phenotypic state that inherits from ancestors
 
-	Node(Substring &genotype, bool _modifierMode, bool _paramMode, bool _cycleMode, Node *parent);
+	Node(Substring &genotype, Node *parent);
 
 	~Node();
@@ -452,5 +463,5 @@
 	 * @return True if the parameter value was change, false otherwise
 	 */
-	bool changeSizeParam(string paramKey, double multiplier, bool ensureCircleSection);
+	bool changeSizeParam(string paramKey,  bool ensureCircleSection);
 
 	/**
@@ -501,4 +512,5 @@
 
 	static int precision;
+	static bool TURN_WITH_ROTATION;
 
 	/**
@@ -511,10 +523,4 @@
 
 	void getState();
-
-	/**
-	 * Get a random multiplier for parameter mutation
-	 * @return Random parameter multiplier
-	 */
-	static double randomParamMultiplier();
 
 	/**
