From 21f152e660cd701b8bd32c084325b72f24678a91 Mon Sep 17 00:00:00 2001 From: jenz Date: Sun, 20 Mar 2022 20:49:05 +0100 Subject: [PATCH] added extra threads again and moved variables to settings file --- .../java/FunctionLayer/PipelineJMWESingleton.java | 2 +- .../main/java/PresentationLayer/DiscordHandler.java | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ArtificialAutism/src/main/java/FunctionLayer/PipelineJMWESingleton.java b/ArtificialAutism/src/main/java/FunctionLayer/PipelineJMWESingleton.java index 44a295f7..1e24f79a 100644 --- a/ArtificialAutism/src/main/java/FunctionLayer/PipelineJMWESingleton.java +++ b/ArtificialAutism/src/main/java/FunctionLayer/PipelineJMWESingleton.java @@ -45,7 +45,7 @@ public class PipelineJMWESingleton { private static IMWEDetector detector; private PipelineJMWESingleton() { - String jmweIndexData = "/home/gameservers/autism_bot/lib/mweindex_wordnet3.0_semcor1.6.data"; // ./lib/mweindex_wordnet3.0_semcor1.6.data + String jmweIndexData = "/home/nonroot/autism_bot/lib/mweindex_wordnet3.0_semcor1.6.data"; // ./lib/mweindex_wordnet3.0_semcor1.6.data String jmweIndexDataLocalTest = "E:/stationær backup filer/Projects/mweindex_wordnet3.0_semcor1.6.data"; File indexFile = new File((String) jmweIndexData); index = new MWEIndex(indexFile); diff --git a/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java b/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java index 00e2481b..d26c3866 100644 --- a/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java +++ b/ArtificialAutism/src/main/java/PresentationLayer/DiscordHandler.java @@ -68,9 +68,9 @@ public class DiscordHandler extends ListenerAdapter { try (DatagramSocket serverSocket = new DatagramSocket(port)) { - String hostIP = "195.154.53.196"; - if (port == 48477 || port == 48478) { - hostIP = "51.158.20.245"; + String hostIP = new settings().getHostIP(); + if (port == new settings().getHostport() || port == new settings().getHostport2()) { + hostIP = new settings().getHostIP2(); } InetAddress ipAddress = InetAddress.getByName(hostIP);//used ip' while (true) { @@ -85,12 +85,11 @@ public class DiscordHandler extends ListenerAdapter { } } - private static StanfordCoreNLP stanfordCoreNLP; private static Datahandler datahandler; private static StanfordCoreNLP stanfordCoreNLPSentiment; - private static ExecutorService executorService = Executors.newFixedThreadPool(1); - private static ExecutorService executorServiceIngame = Executors.newFixedThreadPool(2); + private static ExecutorService executorService = Executors.newFixedThreadPool(3); + private static ExecutorService executorServiceIngame = Executors.newFixedThreadPool(4); //TODO add python program that edits the java code. python program just adds test if statements on //variables until the tests pass