10.07.2015 Views

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

pdf - 395 K - Ecole des mines de Nantes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Appendix D: Source Co<strong>de</strong>1 Agent infrastructure1. Class MAP.Middlewareusing System;using System.Windows.Forms;using System.Diagnostics;namespace MAP{/// /// Utility class for the infrastructure management./// Two configurations are possible: (1) this process on thiscomputer/// is the main host, i.e. the centralized parts of theinfrastructure/// resi<strong>de</strong> in this process, or (2) this process is not the main host:/// it has to communicate with the remote main host for accessing the/// centralized parts of the infrastructure./// These configurations <strong>de</strong>pend on the way the infrastructure isinstalled/// by method Install./// public sealed class Middleware{// For Http Remoting operationsinternal static readonly int SERVER_PORT = 1989;internal static readonly int CLIENT_PORT = 1990;0, 5);// Maximum latency time of network for Messages to be <strong>de</strong>liveredpublic static readonly TimeSpan MAX_LATENCY = new TimeSpan(0,/// /// The address of the current process on this machine./// public static readonly AgentAddress ThisAddress = newAgentAddress(GetProcessId(), GetComputerName());thehost,/// /// The name of the main host machine, i.e. the one on which/// NS and the DF should resi<strong>de</strong>. If this process is the main/// then the value is "localhost"./// private static string MAIN_HOST;/// /// Returns the name of this computer./// /// public static string GetComputerName(){MSc EMOOSE Thesis – http://www.emn.fr/EMOOSE 65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!