From fc53054a2dd5afc2001977d9000c778da031b412 Mon Sep 17 00:00:00 2001 From: Gregor Riegler Date: Mon, 10 Jun 2013 22:14:35 +0200 Subject: [PATCH] [XVSM] run jms simulation only when Util.useJMs==true --- .../sbc/valesriegler/group/GroupAgent.java | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/main/java/at/ac/tuwien/sbc/valesriegler/group/GroupAgent.java b/src/main/java/at/ac/tuwien/sbc/valesriegler/group/GroupAgent.java index 5e6c2fc..97fcd67 100644 --- a/src/main/java/at/ac/tuwien/sbc/valesriegler/group/GroupAgent.java +++ b/src/main/java/at/ac/tuwien/sbc/valesriegler/group/GroupAgent.java @@ -1,19 +1,5 @@ package at.ac.tuwien.sbc.valesriegler.group; -import java.lang.management.ManagementFactory; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.jms.JMSException; -import javax.swing.SwingUtilities; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import at.ac.tuwien.sbc.valesriegler.common.Util; import at.ac.tuwien.sbc.valesriegler.group.gui.DeliveryOverviewModel; import at.ac.tuwien.sbc.valesriegler.group.gui.GroupCreationDetailsRequest; @@ -28,6 +14,13 @@ import at.ac.tuwien.sbc.valesriegler.types.GroupData; import at.ac.tuwien.sbc.valesriegler.types.Order; import at.ac.tuwien.sbc.valesriegler.types.PizzaType; import at.ac.tuwien.sbc.valesriegler.xvsm.GroupAgentXVSM; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.jms.JMSException; +import javax.swing.*; +import java.lang.management.ManagementFactory; +import java.util.*; /** * The Main class of the Group component. @@ -78,7 +71,7 @@ public class GroupAgent { if (!Util.runSimulation) { groupGui = new GroupGUI(); SwingUtilities.invokeLater(groupGui); - } else { + } else if(Util.useJMS) { JMSGroupConnector.getConnectors().put("tcp://localhost:61621?jms.prefetchPolicy.all=1", new JMSGroupConnector("tcp://localhost:61621?jms.prefetchPolicy.all=1")); JMSGroupConnector.getConnectors().put("tcp://localhost:61622?jms.prefetchPolicy.all=1", @@ -139,7 +132,7 @@ public class GroupAgent { public List createGroups(List pizzaTypes1, String pizzeria, int number) { List newDeliveryGroups = new ArrayList<>(); final String fakeAddress = "address"; - final GroupCreationDetailsRequest gc = new GroupCreationDetailsRequest(number, 1000, pizzaTypes1, fakeAddress, + final GroupCreationDetailsRequest gc = new GroupCreationDetailsRequest(number, 100, pizzaTypes1, fakeAddress, pizzeria); for (int i = 0; i < gc.numberOfGroups; i++) { -- 2.43.0