From 89d115971063c34cbc07d1a1fc665f90c5cf2a77 Mon Sep 17 00:00:00 2001 From: Christiaan Goossens Date: Fri, 11 Nov 2016 14:28:23 +0100 Subject: [PATCH] Added some processing --- simulator/.idea/workspace.xml | 217 ++++-------------- .../pos/simulator/SimulatorConfig.class | Bin 902 -> 896 bytes .../pos/simulator/processor/Processor.class | Bin 7138 -> 7193 bytes .../pos/simulator/SimulatorConfig.java | 2 +- .../pos/simulator/processor/Processor.java | 50 ++-- 5 files changed, 81 insertions(+), 188 deletions(-) diff --git a/simulator/.idea/workspace.xml b/simulator/.idea/workspace.xml index 652d70b..9c03114 100644 --- a/simulator/.idea/workspace.xml +++ b/simulator/.idea/workspace.xml @@ -7,13 +7,10 @@ - + + - - - - @@ -35,40 +32,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - @@ -167,6 +131,8 @@ + + @@ -285,8 +251,6 @@ - - @@ -590,18 +554,18 @@ - - + + - + - + - + @@ -657,10 +621,7 @@ - - - - + @@ -675,10 +636,7 @@ - - - - + @@ -687,16 +645,7 @@ - - - - - - - - - @@ -707,8 +656,6 @@ - - @@ -732,10 +679,7 @@ - - - - + @@ -744,16 +688,7 @@ - - - - - - - - - @@ -764,8 +699,6 @@ - - @@ -789,10 +722,7 @@ - - - - + @@ -801,16 +731,7 @@ - - - - - - - - - @@ -821,8 +742,6 @@ - - @@ -846,10 +765,7 @@ - - - - + @@ -858,16 +774,7 @@ - - - - - - - - - @@ -878,8 +785,6 @@ - - @@ -904,16 +809,7 @@ - - - - - - - - - @@ -924,8 +820,6 @@ - - @@ -997,10 +891,6 @@ - - - - @@ -1008,20 +898,10 @@ - - - - - - - - - - - + @@ -1043,20 +923,6 @@ - - - - - - - - - - - - - - @@ -1079,7 +945,6 @@ - @@ -1096,30 +961,40 @@ - - - - - - - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/simulator/out/production/simulator/com/verictas/pos/simulator/SimulatorConfig.class b/simulator/out/production/simulator/com/verictas/pos/simulator/SimulatorConfig.class index 2435287ba2e87662c09588dd65c9cdde8e7d8ee0..e84cc59f4d6abe2db45d9128782b4811e6faf091 100644 GIT binary patch delta 438 zcmX|+y-or_6ot?10K1Y&1O!n~0TD$IR|S9Y7h`N`h=rlrM*Pbb1Z=h91$Y4}d$NUz zg%99E8PAM~Q=ISKJ2U6rJF?&GyYHXRF8~d+qDaA&x$b*@21)EhT5Z;ObhhhYPqS{L z;b32f2M!K3kF+$k9BVnzaw;K46CIt|IJa>zeYzFh64n*wkycp1qJZoSeT59N0MgL{P~EDKndHwr7rD&+L{yp{r16^dHckRBJTtJfqK0HPe2 zP0ZlzW5_0kG&7`?A>9mVXh=^(+8WZCv>?FQsT<5(Qjp=w2gKA|m#GodbX8)Ls{US} zf+{lyTmQd@2(bb*$1z#T#KV&Sv!MVn86ciW1enu~0_AaA7E@J@?{e=t*A}Sp#=`b5 Drc5la delta 446 zcmXAly-or_6ot>-L1rP7h$sk%zlaL{pn!`17-OOqHpJ3`C?ObK4K5ZoQW5)o0bhY^ zXJM>;0N=rvFy0xbIN!N5lXK@zSN7z~*YEoWfHDrlh+|dA@1NHYVpt1S&v~Dhu8KBF znq`S~8ynhg+Nfx5Y1tOAie2q?wCrlx6QJIkcKZ?s5>-O5ecy4e9|?3y2)M1gM*sPk zF6S_>Fp7ji5-EbHbsU8;qzRFm`cu7dTX&j;n%izUO@ch@Jha?KTVWg%1nclZVG?PD zDIGAaWd<3ASuI&4yp(lx730}}Fweqm%uL+LklPq?m?1|Qa+)Cr8gix~#~N}n(*l8C z&${4!TJchj_kvsj0(n+t`~ViQ#FdTZ|GVs61XzKJ7ZTZIbkIj6;A2Smh(?EfjP&`8 Xkn>JNCYI-aS>g8;c~D}f`xgEHLnt#+ diff --git a/simulator/out/production/simulator/com/verictas/pos/simulator/processor/Processor.class b/simulator/out/production/simulator/com/verictas/pos/simulator/processor/Processor.class index 977a8c205fcbea9c3c67f26198d170623d9c19f3..54e45533af1e6c8de8b9a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O5xM2N#ZRN!#ZvFEEVfySPsnWL@GY@+%_w;y-&}-iF%>TQQylumq<3laf3?Ih;|iBr zjcGIFyCylT+>2F2EPbXKbWa_VaxYeAh^5ms@4x~&p3mAUOC~AzVoeICt#@p0u}`nK z)jItYtjJ6|Y{psbV3eZU<*?TFYB`;}ervuMJUG6phEXp=)oX?7y$n5IK4YYg!FfDt zuow-fM>9@fj4eesmNA}|Gk*nf9U7S&nsF!A;7PRLS+wItti`+N5MHbki*dRL;~a55 z&K29RQS5*&?nJM68vWuqw)(?}dKTh*&k~rPjfi`$N78c(HhUh$MV=>cvF90F;&~pI zd0xkro;Prn=Pg{#EKrwMfNS!Km;z*qSWZoAJTEdud=v`0J@@f8|1tP5%kwHO!KHl5 zNKdB?&OUCXjRMM$`PGBVC_`m_uvdDyB2!8uCJZxA6{J(jb<4j znLANgQ|hg2$mc;7RZq*ea}2{elWjV-dd1-IOM_U0E54L1k{XOH~?5 zTE-Pw!X%VakbejhE&Sd_wdY+FGD9C=vUkH{SG`XXeSWFpNSLsbTg#eO=9IJ6yyY{i z_wU4%n(CQ#tUw$sFU}(zuhl$6O51}cQ&HeH8hAU)%^mdO+i@)J%9!J)IoHy6WkD&+ z7*R%*WkI3m;QB1juvgNap~7_1lVJ_N(4?p%WwFIkRjPdI(%Xc$w?!jE#&yxHAqy9m9{{xKbA#`CE z>GzOhH;+9 initialObjectValues = new HashMap<>(); public HashMap objects = new HashMap<>(); - - public ArrayList arguments = new ArrayList<>(); + public HashMap> arguments = new HashMap<>(); public Processor(Object[] objects) throws ProcessingException, WritingException { /** @@ -83,9 +82,9 @@ public class Processor { } //System.out.println("Position during apastron (AU): " + AU.convertFromMeter(object.aphelion)); - System.out.println("Distance from (the) " + SimulatorConfig.sunName + " during apastron in km: " + object.aphelionDistance / 1000 + "\n"); + //System.out.println("Distance from (the) " + SimulatorConfig.sunName + " during apastron in km: " + object.aphelionDistance / 1000 + "\n"); //System.out.println("Position during periastron (AU): " + AU.convertFromMeter(object.perihelion)); - System.out.println("Distance from (the) " + SimulatorConfig.sunName + " during periastron in km: " + object.perihelionDistance / 1000 + "\n"); + //System.out.println("Distance from (the) " + SimulatorConfig.sunName + " during periastron in km: " + object.perihelionDistance / 1000 + "\n"); } else { //System.out.println("Current position (m): " + objects.get(objectName).position + "\n"); //System.out.println("Highest point (z-axis graph) (m): " + object.absoluteMax); @@ -105,17 +104,24 @@ public class Processor { } //System.out.println("Position during apastron (m): " + object.aphelion); - System.out.println("Distance from (the) " + SimulatorConfig.sunName + " during apastron in km: " + object.aphelionDistance / 1000 + "\n"); + ///System.out.println("Distance from (the) " + SimulatorConfig.sunName + " during apastron in km: " + object.aphelionDistance / 1000); //System.out.println("Position during periastron (m): " + object.perihelion); - System.out.println("Distance from (the) " + SimulatorConfig.sunName + " during periastron in km: " + object.perihelionDistance / 1000 + "\n"); + //System.out.println("Distance from (the) " + SimulatorConfig.sunName + " during periastron in km: " + object.perihelionDistance / 1000 + "\n"); } if (object.ascendingNode != null) { System.out.println("Argument of periapsis (radians): " + AOP.calculate(object.ascendingNode, object.perihelion, object.aphelion)); - System.out.println("Argument of periapsis (degrees): " + Math.toDegrees(AOP.calculate(object.ascendingNode, object.perihelion, object.aphelion))); + //System.out.println("Argument of periapsis (degrees): " + Math.toDegrees(AOP.calculate(object.ascendingNode, object.perihelion, object.aphelion))); if (object.checkNodes()) { - arguments.add(Math.toDegrees(AOP.calculate(object.ascendingNode, object.perihelion, object.aphelion))); + // Add the node to the list + if (arguments.get(objectName) == null) { + // If not defined + ArrayList agmnts = new ArrayList<>(); + arguments.put(objectName, agmnts); + } + + arguments.get(objectName).add(AOP.calculate(object.ascendingNode, object.perihelion, object.aphelion)); } } else { @@ -166,18 +172,30 @@ public class Processor { public void close() throws ProcessingException { try { this.writer.save(); + System.out.println("RESULTS: " + arguments); - // CALCULATE AVERAGE + for(String objectName : SimulatorConfig.objectNames) { + ArrayList arguments = this.arguments.get(objectName); + double score = 0; - double sum = 0; - for (int i = 0; i < arguments.size(); i++){ - sum = sum + arguments.get(i); + // Calculate score + for(int i = 1; i < arguments.size() - 1; i++) { + score = score + Math.abs(arguments.get(i-1) - arguments.get(i)); + } + + System.out.println("SCORE: " + score); + + // CALCULATE AVERAGE + double sum = 0; + for (int i = 0; i < arguments.size(); i++){ + sum = sum + arguments.get(i); + } + // calculate average + double average = sum / arguments.size(); + + System.out.println("AVERAGE (degrees): " + Math.toDegrees(average)); } - // calculate average - double average = sum / arguments.size(); - - System.out.println("AVERAGE: " + average); } catch(WritingException e) { throw new ProcessingException("An error occurred during creation of the file writer: " + e.toString()); }