Index: /pom.xml
===================================================================
--- /pom.xml	(revision 16)
+++ /pom.xml	(revision 17)
@@ -7,5 +7,5 @@
 	<artifactId>runserver</artifactId>
 	<packaging>war</packaging>
-	<version>1.4.4</version> <!-- must equal ${geniusweb.version} -->
+	<version>1.5.0</version> <!-- must equal ${geniusweb.version} -->
 	<name>runserver Maven Webapp</name>
 	<url>http://maven.apache.org</url>
@@ -20,5 +20,5 @@
 		<jackson-2-version>2.9.10</jackson-2-version>
 		<tomcat.version>8.0.53</tomcat.version>
-		<geniusweb.version>1.4.4</geniusweb.version>
+		<geniusweb.version>1.5.0</geniusweb.version>
 	</properties>
 
@@ -79,5 +79,5 @@
 			<groupId>tudelft.utilities</groupId>
 			<artifactId>repository</artifactId>
-			<version>1.1.0</version>
+			<version>1.1.1</version>
 		</dependency>
 
Index: /src/main/java/geniusweb/runserver/WebSocketProtToPartyConn.java
===================================================================
--- /src/main/java/geniusweb/runserver/WebSocketProtToPartyConn.java	(revision 16)
+++ /src/main/java/geniusweb/runserver/WebSocketProtToPartyConn.java	(revision 17)
@@ -25,5 +25,5 @@
 import geniusweb.actions.Action;
 import geniusweb.actions.PartyId;
-import geniusweb.party.inform.Inform;
+import geniusweb.inform.Inform;
 import geniusweb.protocol.partyconnection.ProtocolToPartyConn;
 import geniusweb.references.Reference;
Index: /src/main/webapp/index.jsp
===================================================================
--- /src/main/webapp/index.jsp	(revision 16)
+++ /src/main/webapp/index.jsp	(revision 17)
@@ -1,15 +1,21 @@
 <html>
+<head>
+<link rel="stylesheet" type="text/css" href="style.css" />
+</head>
 <body>
-<h1>GeniusWeb Run Server</h1>
+	<h1>GeniusWeb Run Server</h1>
 
-<a href="newsession.xhtml">new session</a>
-<br>
-<a href="newtournament.xhtml">new tournament</a>
-<br>
-<a href="running.xhtml">view currently running negotiations</a>
-<br>
-<a href="log">view logs</a>
-<p>
-	For help and more info, please refer to the <a href="https://tracinsy.ewi.tudelft.nl/pubtrac/GeniusWebRunServer"> run server page</a>. 
+	<!-- the onclick construct is to pass through the search term in the URL  -->
+	<aa onclick="window.location='newsession.xhtml'+window.location.search;" >new session</aa>
+	<br>
+	<aa onclick="window.location='newtournament.xhtml'+window.location.search;" >new tournament</aa>
+	<br>
+	<aa onclick="window.location='running.xhtml'+window.location.search;" >view currently running negotiations</aa>
+	<br>
+	<a href="log">view logs</a>
+	<p>
+		For help and more info, please refer to the <a
+			href="https://tracinsy.ewi.tudelft.nl/pubtrac/GeniusWebRunServer">
+			run server page</a>.
 </body>
 </html>
Index: /src/main/webapp/newsession.xhtml
===================================================================
--- /src/main/webapp/newsession.xhtml	(revision 16)
+++ /src/main/webapp/newsession.xhtml	(revision 17)
@@ -4,5 +4,4 @@
 <title>Profiles and Domains list</title>
 <link rel="stylesheet" type="text/css" href="style.css" />
-
 </head>
 <body onload="init()">
@@ -14,9 +13,21 @@
 	<br /> Protocol:
 	<select id="selectedprotocol" onchange="selectProtocol()">
-		<option value="SAOP">SAOP (stacked alternating offers)</option>
-		<option value="SHAOP">SHAOP (stacked human alternating
-			offers)</option>
+		<option value="SAOP">SAOP ( Stacked Alternating Offers
+			Protocol )</option>
+		<option value="MOPAC">MOPAC (Multiple Offers Partial
+			Consensus)</option>
+		<option value="AMOP">AMOP (Alternating Multiple Offers
+			Protocol)</option>
+		<option value="SHAOP">SHAOP (Stacked Human Alternating Offers
+			Protocol)</option>
 	</select>
 
+	<div id="votingevaluator">
+		<br /> Voting Evaluator: <select id="selectedevaluator">
+			<option value="LargestAgreement">Largest Agreement</option>
+			<option value="LargestAgreementsLoop">Largest Agreements and Repeat</option>
+		</select>
+	</div>
+	
 	<br /> Deadline:
 	<input type="number" id="deadlinevalue" name="deadline" min="1"
@@ -29,5 +40,5 @@
 	<br /> Domain/Profile Server:
 	<input type="url" name="url" id="profilesserverurl"
-		value="localhost:8080/profilesserver-1.4.4"
+		value="localhost:8080/profilesserver-1.5.0"
 		pattern=".*:[0-9]+/profilesserver" size="30"
 		onchange="connectDomain()"> </input>
@@ -43,5 +54,5 @@
 		<br /> <b>Participants</b> <br /> Parties Server: <input type="url"
 			name="url" id="partiesserverurl"
-			value="localhost:8080/partiesserver-1.4.4"
+			value="localhost:8080/partiesserver-1.5.0"
 			pattern=".*:[0-9]+/partiesserver" size="30"
 			onchange="connectParties()"> </input> <br /> <br /> <b>Party
@@ -63,7 +74,8 @@
 				<input type="text" id="cobfilter" value="" maxlength="40" /> <br />
 				<!--  -->
-				Parameters: { <textarea  id="cobparameters" rows="2" cols="70"
-					onchange="updateCobParameters()" value="" /> } <br />
-				<br />
+				Parameters: {
+				<textarea id="cobparameters" rows="2" cols="70"
+					onchange="updateCobParameters()" value="" />
+				} <br /> <br />
 			</div>
 		</div>
@@ -115,4 +127,6 @@
 
 <script type="application/javascript">
+	
+	
 	
 	
@@ -186,4 +200,7 @@
 	    tbl.getElementsByTagName('col')[4].style.visibility=(visible?'':'collapse');
 	    tbl.getElementsByTagName('col')[5].style.visibility=(visible?'':'collapse');
+	    
+    	var evaluatorvisible=getSelectedProtocol() == "MOPAC";
+    	document.getElementById("votingevaluator").style.display=(evaluatorvisible ? 'block': 'none');
 		
     }   
@@ -198,6 +215,7 @@
     		domainwebsocket=null;
     	}
-		var url=document.getElementById("profilesserverurl").value;
-        var target = "ws://"+url+"/websocket/liststream";
+		var url=new URL("http:"+document.getElementById("profilesserverurl").value);
+		// insert the liststream to the path
+        var target = "ws://"+url.host+url.pathname+"/websocket/liststream"+window.location.search+url.hash;
         if ('WebSocket' in window) {
         	domainwebsocket = new WebSocket(target);
@@ -276,13 +294,13 @@
 	 refresh table: copy all parties elements in there.
 	 Typically parties is something like
-	 [{"uri":"http:130.161.180.1:8080/partiesserver/run/randomparty-1.4.4",
+	 [{"uri":"http:130.161.180.1:8080/partiesserver/run/randomparty-1.5.0",
 		 "capabilities":{"protocols":["SAOP"]},
 		 "description":"places random bids until it can accept an offer with utility >0.6",
-		 "id":"randomparty-1.4.4",
+		 "id":"randomparty-1.5.0",
 		 "partyClass":"geniusweb.exampleparties.randomparty.RandomParty"},
 		 		 ...]
 	 */
 	function updateParties(parties) {
-		 updatePartiesCombobox(parties, document.getElementById("partyselection"),['SAOP','SHAOP']);
+		 updatePartiesCombobox(parties, document.getElementById("partyselection"),['SAOP','AMOP','SHAOP']);
 		 updatePartiesCombobox(parties, document.getElementById("cobpartyselection"),['COB']);
 	}
@@ -483,5 +501,6 @@
 	        		var logurl="log/"+this.responseText+".json";
 	        		document.getElementById("logref").href=logurl;
-	        		document.getElementById("plotref").href="plotlog.xhtml?id="+this.responseText;
+	        		document.getElementById("plotref").href="plotlog.xhtml"+
+	        		combineQuery("?id="+this.responseText,window.location.search);
 	        		
 	        		sometimeWhen(function() { return urlExists(logurl) },
@@ -499,4 +518,17 @@
 
 
+
+	/**
+	@param query1 a query string like &p=q (part of URL)
+	@param query2 another query string 
+	@return the combined querystring of query1 and query2 
+	*/
+	function combineQuery(query1, query2) {
+		if (query1=="") return query2;
+		if (query2=="") return query1;
+		return query1+"&"+query2.substring(1);
+	}
+
+	
 	/**
 	@return true iff the URL exists.
@@ -521,16 +553,38 @@
 	*/
 	function makeRequest() {
-
-		if (getSelectedProtocol()=="SHAOP") {
+		switch(getSelectedProtocol()) {
+		case "SHAOP":
 			return makeShaopRequest();
-		} else {
-			return makeSaopRequest();
+		case"SAOP":
+		case "AMOP":
+			return makeStdRequest(getSelectedProtocol()+"Settings");
+		case "MOPAC":
+			return makeMopacRequest();			
 		} 
 	}
 	
 	/**
-	@return a SAOP request
-	*/
-	function makeSaopRequest() {
+	@return a SAOP/AMOP request
+	The header contains 'SAOSettings' or 'AMOPSettings'
+	*/
+	function makeStdRequest(header) {
+		return JSON.stringify({[header]: standardHeader() });
+	}
+	
+	/**
+	* @ereturn MOPAC request. Almost standard but extra 'votingEvaluator'.
+	*/
+	function makeMopacRequest() {
+		var extended = standardHeader();
+		var combo = document.getElementById("selectedevaluator");
+		var evaluator = combo.options[combo.selectedIndex].value;
+		extended['votingevaluator'] = { [evaluator]: {} };
+		return JSON.stringify({"MOPACSettings": extended });
+	}
+	
+	/**
+	@return standard header with participants and deadline 
+	*/
+	function standardHeader() {
 		var deadline={};
 		var value = document.getElementById("deadlinevalue").value;
@@ -542,7 +596,8 @@
 			deadline["deadlinerounds"] = {"rounds": value, "durationms":10000};
 		}
-		
-		return JSON.stringify({"SAOPSettings": { "participants": partyprofiles, "deadline":deadline }});
-	}
+		return  { "participants": partyprofiles, "deadline":deadline }
+	}
+	
+	
 
 	/**
@@ -577,6 +632,6 @@
 	function init() {
 		selectProtocol();
-		document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.4.4"
-		document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.4.4"
+		document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.5.0"
+		document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.5.0"
 		connectDomain();
 		connectParties();
@@ -592,4 +647,6 @@
 
 
+
+
 </script>
 
Index: /src/main/webapp/newtournament.xhtml
===================================================================
--- /src/main/webapp/newtournament.xhtml	(revision 16)
+++ /src/main/webapp/newtournament.xhtml	(revision 17)
@@ -36,6 +36,21 @@
 			id="protocolselection" onchange="selectProtocol()">
 			<option value="SAOP">SAOP</option>
+			<option value="MOPAC">MOPAC</option>
+			<option value="AMOP">AMOP</option>
 			<option value="SHAOP">SHAOP</option>
-		</select> <br /> Deadline: <input type="number" id="deadlinevalue"
+
+
+		</select> 
+		
+		<div id="votingevaluator">
+			<br /> Voting Evaluator: <select id="selectedevaluator">
+				<option value="LargestAgreement">Largest Agreement</option>
+				<option value="LargestAgreementsLoop">Largest Agreements
+					and Repeat</option>
+			</select>
+		</div>
+
+
+		<br /> Deadline: <input type="number" id="deadlinevalue"
 			name="deadline" min="1" max="10000" value="10" /> <select
 			id="deadlinetype">
@@ -87,6 +102,5 @@
 		<!-- party  1 selection -->
 		Party: <select id="partyselection">
-		</select> 
-		<br /> Parameters: {
+		</select> <br /> Parameters: {
 		<textarea id="parameters" rows="2" cols="70"
 			onchange="getParameters('parameters')" value="" />
@@ -95,6 +109,5 @@
 		<div class="onlySHAOP">
 			COB: <select id="partyselection2">
-			</select> 
-			<br /> Parameters: {
+			</select> <br /> Parameters: {
 			<textarea id="parameters2" rows="2" cols="70"
 				onchange="getParameters('parameters2')" value="" />
@@ -166,4 +179,5 @@
 	
 	
+	
 	// FIXME quick and dirty code. No clean MVC
 	
@@ -186,6 +200,8 @@
     */
     function selectProtocol() {
-    	const isShaop= "SHAOP"==document.getElementById("protocolselection").value;
-    	setStyleSheet('.onlySHAOP','{ display: '+(isShaop? '?':'none')+'; }')
+            const protocol = document.getElementById("protocolselection").value;
+        	setStyleSheet('.onlySHAOP','{ display: '+(protocol=="SHAOP"? '?':'none')+'; }')
+        	
+        	document.getElementById("votingevaluator").style.display=(protocol=="MOPAC" ? 'block': 'none');
     }
     
@@ -536,19 +552,26 @@
 		
 		// create S(H)AOPSettings. [header] is a weird ECMA script workaround for javascript issue.
-		const sessionSettings = { [header]:{"participants":[],"deadline":deadline}};
-		
+		var settingvalues={"participants":[],"deadline":deadline};
+		if (protocol=="MOPAC") {
+			var combo = document.getElementById("selectedevaluator");
+			var evaluator = combo.options[combo.selectedIndex].value;
+			settingvalues['votingevaluator'] = { [evaluator]: {} };
+		} 
+			
+		const sessionSettings = { [header]:settingvalues};
+
 		var teamsFull = [];
 		for (const team of teamslist) {
-			if (protocol=="SAOP") // only first member of team is used.
-				teamsFull.push({"Team":[team[0]]});
+			if (protocol=="SHAOP") 
+				teamsFull.push({"Team":team});
 			else
-				teamsFull.push({"Team":team});
+				teamsFull.push({"Team":[team[0]]}); // most protocols have just 1 member per team
 		}
 		var profilesFull = [] ;
 		for (const profileset of profiles) {
-			if (protocol=="SAOP") // only first member of team is used.
+			if (protocol=="SHAOP") // only first member of team is used.
+				profilesFull.push({"ProfileList":profileset});
+			else
 				profilesFull.push({"ProfileList":[profileset[0]]});
-			else
-				profilesFull.push({"ProfileList":profileset});
 		}
 		
@@ -562,6 +585,6 @@
 	*/
 	function init() {
-		document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.4.4";
-		document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.4.4";
+		document.getElementById("partiesserverurl").value =window.location.hostname+":8080/partiesserver-1.5.0";
+		document.getElementById("profilesserverurl").value =window.location.hostname+":8080/profilesserver-1.5.0";
 
 		selectProtocol();
@@ -587,4 +610,5 @@
 
 
+
 </script>
 
Index: /src/main/webapp/plotlog.xhtml
===================================================================
--- /src/main/webapp/plotlog.xhtml	(revision 16)
+++ /src/main/webapp/plotlog.xhtml	(revision 17)
@@ -4,4 +4,5 @@
 <title>Plot log results</title>
 <script src="Chart.min_2.8.0.js"></script>
+<script src="utils.js"></script>
 </head>
 <style>
@@ -23,10 +24,12 @@
 	<div id="progress">Waiting for log file name</div>
 	<br />
-	<div>Notice, the plotted utilities do not include possible elicitation costs.</div>
+	<div>Notice, the plotted utilities do not include possible
+		elicitation costs.</div>
 	<div style="width: 100%;">
 		<canvas id="canvas"></canvas>
 	</div>
-	
-	Agreement: <div id="agreement" style="display:inline;">?</div>
+
+	Agreement:
+	<div id="agreement" style="display: inline;">?</div>
 </body>
 
@@ -39,4 +42,6 @@
 	
 	
+	
+	
 
 	
@@ -52,8 +57,10 @@
 
         function connect() {
-        	
-        	var id=document.location.search;
-            id = location.search.split('id=')[1]
-            if (id==undefined) return;
+        	var query = new URLSearchParams(location.search);
+        	var id=query.get('id');
+            if (id==undefined) {
+            	alert("missing ?id=<logfile> in URL"); 
+            	return;
+           	}
             
             // load the log file with given id
@@ -96,9 +103,10 @@
         	var profs=json['partyprofiles'];
         	for (var party in profs) {
-        		partyprofiles[party]=profs[party]['profile'].split('?',1)[0]; // hacky, remove complete query.
+        		partyprofiles[party]=withoutPartial(profs[party]['profile']);
         	}
         	
         	getProfiles(json, partyprofiles);
         }
+        
         
         /**
@@ -112,5 +120,5 @@
         		if ( (nr & 1 != 0)) continue; // skip COB parties
         		var shaop=teams[nr/2]['shaop'];
-        		var profile = shaop['profile'].split('?',1)[0]; // hacky, remove complete query.
+        		var profile = withoutPartial(shaop['profile']); // hacky, remove complete query.
         		partyprofiles[partyid]=profile;
         	}
@@ -120,4 +128,17 @@
         }
 
+
+        /**
+        @param uristr a string with an uri that may have ?partial=XX 
+        @return the given uristr   without the "partia=XXl" value 
+        */
+        function withoutPartial(uristr) {
+    		var profuri=new URL(uristr);
+    		var searchParams = new URLSearchParams(profuri.search);
+    		searchParams.delete("partial");
+    		profuri.search = searchParams.toString();
+    		return profuri.toString();
+
+        } 
         
         /**
@@ -371,4 +392,6 @@
 
 
+
+
 </script>
 
@@ -376,4 +399,6 @@
 
 <script type="application/javascript">
+	
+	
 	
 	
@@ -407,4 +432,6 @@
 
 
+
+
 </script>
 
Index: /src/main/webapp/style.css
===================================================================
--- /src/main/webapp/style.css	(revision 16)
+++ /src/main/webapp/style.css	(revision 17)
@@ -23,2 +23,8 @@
 This css is programmatically changed when protocol changes */
 .onlySHAOP { }
+
+/* substitute for <a> as in <a href-..> */
+aa {
+ 	color: blue;
+	text-decoration: underline;
+}
