use of it.unibo.arces.wot.sepa.pattern.ApplicationProfile in project SEPA by arces-wot.
the class ExtremeChat method main.
public static void main(String[] args) throws SEPAProtocolException, SEPASecurityException, SEPAPropertiesException, IOException {
ApplicationProfile app = new ApplicationProfile("chat.jsap");
if (args.length != 2) {
System.out.println("Running with default parameters (you can run with two arguments: <BASE> <N_CLIENTS>");
} else {
BASE = Integer.parseInt(args[0]);
N_CLIENTS = Integer.parseInt(args[1]);
}
for (int i = BASE; i < BASE + N_CLIENTS; i++) {
new Thread(new ExtremeChat(i, app)).start();
}
System.out.println("Press a key to exit...");
System.in.read();
System.exit(0);
}
use of it.unibo.arces.wot.sepa.pattern.ApplicationProfile in project SEPA by arces-wot.
the class ObservationSimulator method main.
public static void main(String[] args) throws SEPAProtocolException, SEPAPropertiesException, InterruptedException {
if (args.length != 2) {
logger.error("Usage: java -jar ObservationSimulator.jar <file.jsap> <observation URI>");
System.exit(1);
}
ObservationSimulator sim = new ObservationSimulator(new ApplicationProfile(args[0]), args[1]);
Thread th = new Thread(sim);
th.start();
th.join();
}
use of it.unibo.arces.wot.sepa.pattern.ApplicationProfile in project SEPA by arces-wot.
the class RandomNumbersTest method main.
public static void main(String[] args) throws SEPAPropertiesException, SEPAProtocolException, SEPASecurityException, IOException {
// First we create the application profile
myApp = new ApplicationProfile("randomNumbers.jsap");
// We can use the JSAP file also to store application specific
// parameters (e.g., the number of random generator)
int nGen = myApp.getExtendedData().get("generators").getAsInt();
logger.info("Number of generators: " + nGen);
// We start the consumers so we can monitor what is happening...
meanMonitor = new MeanMonitor();
if (!meanMonitor.subscribe()) {
logger.fatal("Failed to subscribe Mean Monitor");
System.exit(1);
}
meanCalculator = new MeanCalculator();
if (!meanCalculator.start()) {
logger.fatal("Failed to subscribe Mean Calculator");
System.exit(1);
}
gc = new GarbageCollector();
if (!gc.subscribe()) {
logger.fatal("Failed to subscribe Triples Counter");
System.exit(1);
}
// We create and start the specified number of producers
for (int i = 0; i < nGen; i++) {
new RandomNumberGenerator();
}
System.out.println("Press any key to exit...");
System.in.read();
}
Aggregations