Index: src/main/webapp/newsession.xhtml
===================================================================
--- src/main/webapp/newsession.xhtml	(revision 26)
+++ src/main/webapp/newsession.xhtml	(revision 27)
@@ -22,4 +22,6 @@
 		<option value="SHAOP">SHAOP (Stacked Human Alternating Offers
 			Protocol)</option>
+		<option value="Learn">Learn</option>
+			
 	</select>
 
@@ -45,7 +47,8 @@
 	</select>
 
+	<div id="profserverselector">
 	<br /> Domain/Profile Server:
 	<input type="url" name="url" id="profilesserverurl"
-		value="localhost:8080/profilesserver-1.5.9"
+		value="localhost:8080/profilesserver-1.6.0"
 		pattern=".*:[0-9]+/profilesserver.*" size="30"
 		onchange="connectDomain()"> </input>
@@ -54,5 +57,6 @@
 		<!-- <option>Waiting for profiles server</option> -->
 	</select>
-
+	</div>
+	
 	<br />
 	<br />
@@ -61,10 +65,14 @@
 		<br /> <b>Participants</b> <br /> Parties Server: <input type="url"
 			name="url" id="partiesserverurl"
-			value="localhost:8080/partiesserver-1.5.9"
+			value="localhost:8080/partiesserver-1.6.0"
 			pattern=".*:[0-9]+/partiesserver.*" size="30"
 			onchange="connectParties()"> </input> <br /> <br /> <b>Party
 			settings</b> <br /> Party : <select id="partyselection">
-		</select> <br /> Profile: <select id="profileselection"></select> Filter: <input
+		</select> <br /> 
+		
+		<div id="profileselector">
+		Profile: <select id="profileselection"></select> Filter: <input
 			type="text" id="filter" value="" maxlength="40" /> <br />
+		</div>
 		Parameters: {
 		<textarea id="parameters" rows="2" cols="70"
@@ -214,6 +222,28 @@
     	document.getElementById("votingevaluator2").style.display=(evaluator2visible ? 'block': 'none');
 
-    }   
-        
+    	
+    	var profileselectorvisible=!isUsingFakeProfile();
+    	document.getElementById("profserverselector").style.display=(profileselectorvisible ? 'block': 'none');
+    	document.getElementById("profileselector").style.display=(profileselectorvisible ? 'block': 'none');
+    	if (getSelectedProtocol() == "Learn") {
+    		params = {"persistentstate":createUUID(), "negotiationdata":[ createUUID() ] };
+    		str=JSON.stringify(params);
+    		// remove outer brackets from the text in the box
+        	document.getElementById("parameters").value=str.substring(1, str.length-1);
+    		updateParameters();
+    	}
+    }
+
+    /**
+    @return true iff we need to use a fake profile.
+    */
+    function isUsingFakeProfile() {
+    	return  getSelectedProtocol() == "Learn";
+    }
+    
+    function isUsingCobParty() {
+    	return getSelectedProtocol() == "SHAOP";
+    }
+    
 	/**
 	Refresh known domains using given profilesserver URL. 
@@ -304,8 +334,8 @@
 	 refresh table: copy all parties elements in there.
 	 Typically parties is something like
-	 [{"uri":"http:130.161.180.1:8080/partiesserver/run/randomparty-1.5.9",
+	 [{"uri":"http:130.161.180.1:8080/partiesserver/run/randomparty-1.6.0",
 		 "capabilities":{"protocols":["SAOP"]},
 		 "description":"places random bids until it can accept an offer with utility >0.6",
-		 "id":"randomparty-1.5.9",
+		 "id":"randomparty-1.6.0",
 		 "partyClass":"geniusweb.exampleparties.randomparty.RandomParty"},
 		 		 ...]
@@ -391,5 +421,7 @@
 	function addParty() {
 		addNormalParty();
-		addCobParty();
+		if (isUsingCobParty()) {
+			addCobParty();
+		}
 		updatePartyProfileTable(); // what, MVC?
 	}
@@ -400,11 +432,17 @@
 		var filteroptions = document.getElementById("filter").value;
 		
-		if (partycombo.options.length==0) {
-			alert("Please set partier server and select a party");
-			return;
-		}
-		if (profilecombo.options.length==0) {
-			alert("Please set domain/profile server and select a domain and a profile");
-			return;
+		var selectedprofile;
+		if (isUsingFakeProfile()) {
+			selectedprofile="not://valid";
+		} else {
+			if (partycombo.options.length==0) {
+				alert("Please set partier server and select a party");
+				return;
+			}
+			if (profilecombo.options.length==0) {
+				alert("Please set domain/profile server and select a domain and a profile");
+				return;
+			}
+			selectedprofile=profilecombo.options[profilecombo.selectedIndex].value +filteroptions;
 		}
 		
@@ -415,5 +453,5 @@
 		newpartyprof["party"]={"partyref":partycombo.options[partycombo.selectedIndex].value , 
 				"parameters":parameters };
-		newpartyprof["profile"]=profilecombo.options[profilecombo.selectedIndex].value +filteroptions;
+		newpartyprof["profile"]=selectedprofile;
 		
 		partyprofiles.push(newpartyprof)
@@ -464,8 +502,5 @@
 			var cell2 = row.insertCell(-1);
 			var cell3 = row.insertCell(-1);
-			var cell4 = row.insertCell(-1);
-			var cell5 = row.insertCell(-1);
-			var cell6 = row.insertCell(-1);
-			
+
 			cell1.innerHTML = partyprofiles[pp]["party"]["partyref"];
 			// help browser breaking too large strings 
@@ -473,8 +508,16 @@
 			cell2.setAttribute("style","overflow-wrap: anywhere;");
 			cell3.innerHTML = partyprofiles[pp]["profile"];
-			cell4.innerHTML = cobpartyprofiles[pp]["party"]["partyref"];
-			cell5.innerHTML = JSON.stringify(cobpartyprofiles[pp]["party"]["parameters"]).replace(/,/g,", ");
-			cell5.setAttribute("style","overflow-wrap: anywhere;");
-			cell6.innerHTML = cobpartyprofiles[pp]["profile"];
+
+			if (isUsingCobParty()) {
+				var cell4 = row.insertCell(-1);
+				var cell5 = row.insertCell(-1);
+				var cell6 = row.insertCell(-1);
+				cell4.innerHTML = cobpartyprofiles[pp]["party"]["partyref"];
+				cell5.innerHTML = JSON.stringify(cobpartyprofiles[pp]["party"]["parameters"]).replace(/,/g,", ");
+				cell5.setAttribute("style","overflow-wrap: anywhere;");
+				cell6.innerHTML = cobpartyprofiles[pp]["profile"];
+
+			}
+			
 		}
 
@@ -496,6 +539,7 @@
 	*/
 	function start() {
-		if (Object.keys(partyprofiles).length <2) {
-			alert("At least 2 parties are needed to run a session.");
+		var minParties = getSelectedProtocol() == "Learn" ? 1: 2;
+		if (Object.keys(partyprofiles).length < minParties) {
+			alert("At least "+minParties+" parties are needed to run a "+getSelectedProtocol()+" session.");
 			return;
 		}
@@ -568,4 +612,5 @@
 		case"SAOP":
 		case "AMOP":
+		case "Learn":
 			return makeStdRequest(getSelectedProtocol()+"Settings");
 		case "MOPAC":
@@ -650,4 +695,16 @@
 	}
 
+	/**
+	@return a random UUID. 
+	Note − This should not be used in production as GUID or UUID 
+	generated by Math.Random() may not be unique.
+	*/
+	function createUUID() {
+		   return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
+		      var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
+		      return v.toString(16);
+		   });
+	}
+
 	
 	/**
@@ -656,6 +713,6 @@
 	function init() {
 		selectProtocol();
-		document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.5.9"
-		document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.5.9"
+		document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.6.0"
+		document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.6.0"
 		connectDomain();
 		connectParties();
@@ -672,5 +729,4 @@
 
 
-
 </script>
 
