<commit_before>package examples;

import org.cmg.jresp.behaviour.Agent;
import org.cmg.jresp.comp.Node;
import org.cmg.jresp.knowledge.ActualTemplateField;
import org.cmg.jresp.knowledge.FormalTemplateField;
import org.cmg.jresp.knowledge.Template;
import org.cmg.jresp.knowledge.Tuple;
import org.cmg.jresp.knowledge.ts.TupleSpace;
import org.cmg.jresp.topology.PointToPoint;
import org.cmg.jresp.topology.Self;
import org.cmg.jresp.topology.VirtualPort;

public class Chapter_2_Remote_Evaluation {

	// This virtual port will be used by all the nodes
	public static VirtualPort vp = new VirtualPort(8080);

	public static void main(String[] argv) {

		// We first create the server node
		Node server = new Node("server", new TupleSpace());
		// ... and the agent for serving code execution requests
		Agent code_server = new Server("server");
		server.addAgent(code_server);
		server.addPort(vp);
		// Note that we start the node since clients need to communicate with the node
		// starting the server *before* avoids clients to crash
		server.start();

		int N = 10;
		Node[] client = new Node[N];
		Agent[] clients = new Client[N];
		for(int i=0; i<N; i++){
			client[i] = new Node("client"+i, new TupleSpace());
			clients[i] = new Client(i);
			client[i].addAgent(clients[i]);
			client[i].addPort(vp);
		}
		
		for(int i=0; i<N; i++){
			client[i].start();
		}

	}<commit_msg>minor change in example<commit_after>package examples;

import org.cmg.jresp.behaviour.Agent;
import org.cmg.jresp.comp.Node;
import org.cmg.jresp.knowledge.ActualTemplateField;
import org.cmg.jresp.knowledge.FormalTemplateField;
import org.cmg.jresp.knowledge.Template;
import org.cmg.jresp.knowledge.Tuple;
import org.cmg.jresp.knowledge.ts.TupleSpace;
import org.cmg.jresp.topology.PointToPoint;
import org.cmg.jresp.topology.Self;
import org.cmg.jresp.topology.VirtualPort;

public class Chapter_2_Remote_Evaluation {

	// This virtual port will be used by all the nodes
	public static VirtualPort vp = new VirtualPort(8080);

	public static void main(String[] argv) {

		// We first create the server node
		Node server = new Node("server", new TupleSpace());
		// ... and the agent for serving code execution requests
		Agent code_server = new Server("server");
		server.addAgent(code_server);
		server.addPort(vp);
		// Note that we start the node since clients need to communicate with the node
		// starting the server *before* avoids clients to crash
		server.start();

		int N = 1;
		Node[] client = new Node[N];
		Agent[] clients = new Client[N];
		for(int i=0; i<N; i++){
			client[i] = new Node("client"+i, new TupleSpace());
			clients[i] = new Client(i);
			client[i].addAgent(clients[i]);
			client[i].addPort(vp);
		}
		
		for(int i=0; i<N; i++){
			client[i].start();
		}

	}
{'fraction_non_alphanumeric': 0.12954300107952502, 'fraction_numerical': 0.0061173083843109035, 'mean_word_length': 4.225563909774436, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7593635', 'n_tokens_mistral': 1012, 'n_tokens_neox': 916, 'n_words': 253}