From f9c758de995846c94355bd7b813b475bc65fef1b Mon Sep 17 00:00:00 2001 From: Christiaan Goossens Date: Tue, 8 Nov 2016 20:42:46 +0100 Subject: [PATCH] Fixed all bugs, prepare for formatting. --- simulator/.idea/workspace.xml | 355 +++++++++--------- .../com/verictas/pos/simulator/Main.class | Bin 1867 -> 2052 bytes .../verictas/pos/simulator/Simulator.class | Bin 3468 -> 3557 bytes .../pos/simulator/SimulatorConfig.class | Bin 811 -> 902 bytes .../pos/simulator/mathUtils/AOP.class | Bin 875 -> 872 bytes .../simulator/processor/ObjectProcessor.class | Bin 7194 -> 7513 bytes .../pos/simulator/processor/Processor.class | Bin 7503 -> 7138 bytes .../src/com/verictas/pos/simulator/Main.java | 1 + .../com/verictas/pos/simulator/Simulator.java | 6 +- .../pos/simulator/SimulatorConfig.java | 15 +- .../verictas/pos/simulator/mathUtils/AOP.java | 6 +- .../simulator/processor/ObjectProcessor.java | 84 +++-- .../pos/simulator/processor/Processor.java | 44 ++- 13 files changed, 277 insertions(+), 234 deletions(-) diff --git a/simulator/.idea/workspace.xml b/simulator/.idea/workspace.xml index 756f4a9..652d70b 100644 --- a/simulator/.idea/workspace.xml +++ b/simulator/.idea/workspace.xml @@ -7,10 +7,12 @@ - + + + @@ -34,116 +36,34 @@ - - - - - - - - - - - - + + - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - + + + @@ -189,18 +109,18 @@ - @@ -648,7 +590,7 @@ - + @@ -656,10 +598,10 @@ - + - + @@ -695,7 +637,7 @@ - @@ -716,7 +658,6 @@ - @@ -735,7 +676,6 @@ - @@ -747,8 +687,16 @@ - + + + + + + + + + @@ -759,6 +707,8 @@ + + @@ -783,7 +733,6 @@ - @@ -795,8 +744,16 @@ - + + + + + + + + + @@ -807,6 +764,8 @@ + + @@ -831,7 +790,6 @@ - @@ -843,8 +801,16 @@ - + + + + + + + + + @@ -855,6 +821,8 @@ + + @@ -879,7 +847,6 @@ - @@ -891,8 +858,16 @@ - + + + + + + + + + @@ -903,6 +878,8 @@ + + @@ -927,8 +904,16 @@ - + + + + + + + + + @@ -939,6 +924,8 @@ + + @@ -998,13 +985,6 @@ - - - - - - - @@ -1013,17 +993,6 @@ - - - - - - - - - - - @@ -1035,63 +1004,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - - - - @@ -1099,10 +1024,9 @@ - - + + - @@ -1119,20 +1043,83 @@ + + + + + + + + + + + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/simulator/out/production/simulator/com/verictas/pos/simulator/Main.class b/simulator/out/production/simulator/com/verictas/pos/simulator/Main.class index 38f42f4590b211686170e170285bbb447dc47ea8..971084f44fc7b4c864273bae68c0900178885d2f 100644 GIT binary patch delta 660 zcmYLFT}YE*7(LIoZ}0atmqn~%dSMH)oXesqsDxuByNSVQlrALjXNJ@qe*3X9vmecz zWvwqW`%%-f3@?lVhms2-g2ITd3xckqZj|UEFnTsGdM}>mJm-DSc@FRU-0tgX2~k{8a8<>C@Kjh2(1)2-x;n}(9hZn~|PlADJ0IJpk0xFf2+uGH?Y8R-@2KfZof zTXadd-Yjj=_kHXTuE}Vp$LDd1wD-GX;Kipwkxt}%7*CCU6Y1UbrF>$nFSF>b3HNYc z!H9xU{S~dqa;RR@=OnL)Ax^OAVacYK7;GD37*p`TjB!ku@i0?jc%(NON;VT@Z@m^V zV-gbz9-Hw5Q-lIm=IbfL@BF;RaBDoMMLk+LU4;KCb0iRZ z#<{lhw2M1&H`-@G&$8Dixr!{Q;1px?>I0lc2TyBo2A#~XSSms;&!GP24aPF+nuiqF z&|pF1JVd~PpasV)Xqm;@6mnOo;}(Q02xqCbS!}9Q)R!zW6#E0R!yhp2^aq4h_6HQJ z(O;=r)fBY``d_hSR-VJXLH zZX51ox$7T26r9KpbS)e1C8c8devSt`^!wlb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t(iQ$h&> zub|tf%vogt8tk@gtzoWmAH%(;cnIq_mZy>j$WhG7ljr8ibMjlHRmfSt8w;u%?~y%0Qi5U ziZlRP=!RUfS+~GVHJC@j%{1$qvU!Gyq-r0Ex$*{ukyoD0Nf4Ou f9YrZYT~AE&-)A^i#8A6|eVF^#@Ky1lVDbL}@HG_K 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 2c58e041a8ee36f25c437b1fd374b04ef62d9adf..977a8c205fcbea9c3c67f26198d170623d9c19f3 100644 GIT binary patch literal 7138 zcmcgx3wRXO75?vLli6&Bhaur5-~y621S3QYh^z@nFb|pssAzTAOp=w&&N{n`Vr#XE zT3cVB)>3O#Y#Sf-mBND3qP1#UYqhPmwzV(qQ~R*CwzVjv|DBoL%*L=E+J5Exa`(=i zbIv{Izvp#_XAV8OAHX7Unjh!lRt2B)!-HE3aSm>i!{-&;?ni;Wa)*LD{V22_cKZ4H zE;)QbvV5@!U&3G!?#4ZGxL3h_g($|C72NMf32v1%56Iy`x%`k^d$pcB8hoAZIb02;opMEKaU-|J0UiIPEe*6Z%m74y}kM;Pygz67IyynB}a`BIH_>&y| zES36;1n&(w{MCmyCGFqj@OK4oN$!96@J|K*Qt-A9|MufdY0d^5Q1Fg|cLfSAFvAJm z6sT(n83VPObu%1FXz|*Z5wDGh2a*vjVVJc&T0&cI5!N>JHkk-VYFBIV{#GqU+QQCoUsOvZO2QDkUpUzg6#rFy(f362%$$sALvh$M&4$E zUPTz^F>2m#{#2o1ql!=A8WmUJ6Dkc9itwl+Pk0#=s>l}wDp!00vvbI9x3Zs#t8uBo zq8x-Hk!!PL%vVLB@T;OosHzwz#;an2n5c-OR8fpWs+c57R8fjcRWVu4reM1&rb^AG zVY?!xtKw)eLtx72usS6fj`YaF67c&^%K8`RXzvPkHMh3~nu1-yhJY$&idl>+RU9J% z0=^m&bhkAH6fs-H#kfwspTpw{WJyuQTtSj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B_APXinLNzE@GgoOyyN*9(tRXncV9^Ajpt!o=V2oU&q?TT!(57mu59Y(GZT z%otb4dVsC%?|#DZe9iq_;rMzb1qE)Qg10j9-$sAGmC640oH{|Oa|2bBDSlc`iD_<% zr|;lHdA{L{WPL+}?==J!>=h?4+AWZ7qN*Rp&92 cT^%IY3VatT_~>{W+yJMy@c*rx@Zq-q0{%-5ZvX%Q diff --git a/simulator/src/com/verictas/pos/simulator/Main.java b/simulator/src/com/verictas/pos/simulator/Main.java index 0b51bb3..933662b 100644 --- a/simulator/src/com/verictas/pos/simulator/Main.java +++ b/simulator/src/com/verictas/pos/simulator/Main.java @@ -41,6 +41,7 @@ public class Main { Object jupiter = new Object("Jupiter", 1898.13E24, AU.convertToMeter(new Vector3d(-5.172279968303672E+00,1.591564562098799E+00,1.090553487095606E-01)), AU.convertToMetersPerSecond(new Vector3d(-2.306423668033420E-03,-6.856869314900905E-03,8.012916249248967E-05))); Object saturn = new Object("Saturn", 5.68319E26, AU.convertToMeter(new Vector3d(-3.710637850378867E+00,-9.289569433157130E+00,3.091990731378936E-01)), AU.convertToMetersPerSecond(new Vector3d(4.874750391005278E-03,-2.086615906689840E-03,-1.574898601194673E-04))); Object venus = new Object("Venus", 48.685E23, AU.convertToMeter(new Vector3d(-7.130901319004951E-01,-5.719763212192740E-02,4.040076577877051E-02)), AU.convertToMetersPerSecond(new Vector3d(1.525993024372452E-03,-2.024175581604569E-02,-3.656582385749146E-04))); + Object mars = new Object("Mars", 6.4185E23, AU.convertToMeter(new Vector3d(-1.644664047074283E+00,1.714211195991345E-01,4.385749324150048E-02)), AU.convertFromMetersPerSecond(new Vector3d(-9.128062787682906E-04, -1.271783289037382E-02, -2.442517367300464E-04))); /** * Object listing diff --git a/simulator/src/com/verictas/pos/simulator/Simulator.java b/simulator/src/com/verictas/pos/simulator/Simulator.java index 3b784a4..9df6e9f 100644 --- a/simulator/src/com/verictas/pos/simulator/Simulator.java +++ b/simulator/src/com/verictas/pos/simulator/Simulator.java @@ -56,7 +56,11 @@ public class Simulator { /** * The round has started */ - System.out.println("Round " + (Simulator.round + 1) + " started!"); + if(SimulatorConfig.logConsole) { + if(SimulatorConfig.skipConsole == -1 || Simulator.round % SimulatorConfig.skipConsole == 0 || Simulator.round == 1) { + System.out.println("Round " + Simulator.round + " started!"); + } + } for(int i = 0; i < objects.length; i++) { objects[i].updatePosition(time); diff --git a/simulator/src/com/verictas/pos/simulator/SimulatorConfig.java b/simulator/src/com/verictas/pos/simulator/SimulatorConfig.java index f24b667..0b1a924 100644 --- a/simulator/src/com/verictas/pos/simulator/SimulatorConfig.java +++ b/simulator/src/com/verictas/pos/simulator/SimulatorConfig.java @@ -5,7 +5,7 @@ public class SimulatorConfig { * Time settings */ - public static int rounds = 526100 * 35; // Amount of rounds to run the simulator for + public static int rounds = 526100 * 250; // Amount of rounds to run the simulator for public static double time = 60; // Time steps in seconds /** @@ -15,13 +15,6 @@ public class SimulatorConfig { public static String sunName = "Sun"; // The name of the sun to calculate values TO public static String[] objectNames = { "Earth" }; // The name of the object(s) your want to calculate the values OF - /** - * Ascending & descending node detection - */ - - //public static double z = -22439680.6; // Reference z height for the used system in meters - //public static double zThreshold = 1000; // Threshold value to specify the maximum value (in meters) the z difference can be to be considered close to the reference plane (To eliminate all bending points that are to far away from the z-axis to count as nodes) - /** * Output preferences */ @@ -30,4 +23,10 @@ public class SimulatorConfig { public static int outputNumbers = 0; // Preferred way of outputting numbers: (0 => comma for decimals, dot in large numbers OR 1 => comma for large numbers, dot with decimals) public static int skipLines = 1440; // Set the skipLines integer to skip lines (for example: every 5th line is written) in the output file (for smaller files), if this is set to 1, it has no effect and all lines will be written. public static boolean skipUnnecessary = true; // Skip the unnecessary objects in the export + + /** + * Console settings + */ + public static boolean logConsole = false; + public static int skipConsole = 100000; } diff --git a/simulator/src/com/verictas/pos/simulator/mathUtils/AOP.java b/simulator/src/com/verictas/pos/simulator/mathUtils/AOP.java index 5ca7164..ccf63e7 100644 --- a/simulator/src/com/verictas/pos/simulator/mathUtils/AOP.java +++ b/simulator/src/com/verictas/pos/simulator/mathUtils/AOP.java @@ -10,10 +10,10 @@ public class AOP { Vector3d eccentricity = new Vector3d(0,0,0); eccentricity.sub(perihelion, aphelion); - if (perihelion.getY() > ascendingNode.getY()) { - return ascendingNode.angle(eccentricity); - } else { + if (eccentricity.getZ() < 0) { return (2 * Math.PI) - ascendingNode.angle(eccentricity); + } else { + return ascendingNode.angle(eccentricity); } } } diff --git a/simulator/src/com/verictas/pos/simulator/processor/ObjectProcessor.java b/simulator/src/com/verictas/pos/simulator/processor/ObjectProcessor.java index bb88fd3..49448f8 100644 --- a/simulator/src/com/verictas/pos/simulator/processor/ObjectProcessor.java +++ b/simulator/src/com/verictas/pos/simulator/processor/ObjectProcessor.java @@ -16,12 +16,12 @@ public class ObjectProcessor { public double aphelionDistance = -1; public double perihelionDistance = -1; - public Object thisObject; - public Object referenceObject; + private Object thisObject; + private Object referenceObject; - public Vector3d startingPosition; - public double lastStartDistance = -1; - public double beforeLastStartDistance = -1; + private Vector3d startingPosition; + private double lastStartDistance = -1; + private double beforeLastStartDistance = -1; public Node ascendingNode; public Node descendingNode; @@ -29,12 +29,17 @@ public class ObjectProcessor { public Node absoluteMax; public Node absoluteMin; - public Node carryOverNode; - public int carryOverBit; + private Node carryOverNode; + private int carryOverBit; public double referenceZ; - public HashMap history = new HashMap<>(); + private HashMap history = new HashMap<>(); + + private double lastMaxRound = -1; + private double lastMinRound = -1; + + private boolean skipNodes = false; public void setStartingPosition(Vector3d position) { this.startingPosition = position; @@ -108,23 +113,11 @@ public class ObjectProcessor { } if (this.thisObject.position.getZ() > this.absoluteMax.getZ()) { - /** - * If the next maximum is more than 50 timesteps removed from the last, we've a problem - */ - if (Simulator.round > this.absoluteMax.round + (SimulatorConfig.time * 500)) { - System.out.println("ERROR: I already have a maximum (" + this.absoluteMax + "), but a new one (" + this.thisObject.position + ") has presented itself."); - } this.absoluteMax = new Node(this.thisObject.position); this.absoluteMax.setRound(Simulator.round); } if (this.thisObject.position.getZ() < this.absoluteMin.getZ()) { - /** - * If the next minimum is more than 50 timesteps removed from the last, we've a problem - */ - if (Simulator.round > this.absoluteMin.round + (SimulatorConfig.time * 500)) { - System.out.println("ERROR: I already have a minimum (" + this.absoluteMin + "), but a new one (" + this.thisObject.position + ") has presented itself."); - } this.absoluteMin = new Node(this.thisObject.position); this.absoluteMin.setRound(Simulator.round); } @@ -149,7 +142,9 @@ public class ObjectProcessor { Node result = this.findNode(this.absoluteMin, this.carryOverNode); if (!result.empty()) { - System.out.println("INFO:: Found descending node in round " + result.round + "\n"); + if (SimulatorConfig.logConsole) { + System.out.println("INFO:: Found descending node in round " + result.round + "\n"); + } this.descendingNode = result; } } else { @@ -157,7 +152,9 @@ public class ObjectProcessor { Node result = this.findNode(this.carryOverNode, this.absoluteMax); if (!result.empty()) { - System.out.println("INFO:: Found ascending node in round " + result.round + "\n"); + if (SimulatorConfig.logConsole) { + System.out.println("INFO:: Found ascending node in round " + result.round + "\n"); + } this.ascendingNode = result; } } @@ -181,7 +178,9 @@ public class ObjectProcessor { Node result = this.findNode(this.absoluteMin, this.absoluteMax); if (!result.empty()) { - System.out.println("INFO:: Found ascending node in round " + result.round + "\n"); + if (SimulatorConfig.logConsole) { + System.out.println("INFO:: Found ascending node in round " + result.round + "\n"); + } this.ascendingNode = result; } @@ -195,7 +194,9 @@ public class ObjectProcessor { Node result = this.findNode(this.absoluteMin, this.absoluteMax); if (!result.empty()) { - System.out.println("INFO:: Found descending node in round " + result.round + "\n"); + if (SimulatorConfig.logConsole) { + System.out.println("INFO:: Found descending node in round " + result.round + "\n"); + } this.descendingNode = result; } @@ -208,9 +209,31 @@ public class ObjectProcessor { private Node findNode(Node min, Node max) { this.referenceZ = (min.getZ() + max.getZ()) / 2; - System.out.println("INFO:: Called node finder with min: " + min + " (round " + min.round + ") and max: " + max + " (round " + max.round + ") and a reference height of " + referenceZ); + + if (SimulatorConfig.logConsole) { + System.out.println("INFO:: Called node finder with min: " + min + " (round " + min.round + ") and max: " + max + " (round " + max.round + ") and a reference height of " + referenceZ); + } + Node returnNode = new Node(); + if (lastMaxRound == -1 || lastMaxRound == -1) { + lastMinRound = min.round; + lastMaxRound = max.round; + } else { + // You should compare these values to check. + if (lastMaxRound < min.round && max.round < min.round && min.round == lastMinRound) { + // max2 > max1 > (min1 = min2) + System.out.println("WARNING:: This round's values for the nodes shouldn't be trusted. They are calculated incorrectly."); + this.skipNodes = true; + } + + if (lastMinRound < max.round && min.round < max.round && max.round == lastMaxRound) { + // (max1 = max2) > min1 > min2 + System.out.println("WARNING:: This round's values for the nodes shouldn't be trusted. They are calculated incorrectly."); + this.skipNodes = true; + } + } + for (Map.Entry entry : this.history.entrySet()) { Integer round = entry.getKey(); Vector3d[] vectorArray = entry.getValue(); @@ -243,6 +266,10 @@ public class ObjectProcessor { } } + public boolean checkNodes() { + return !this.skipNodes; + } + /** * Processes the round check */ @@ -259,7 +286,9 @@ public class ObjectProcessor { if (beforeLastStartDistance > lastStartDistance && startDistance > lastStartDistance) { // Last point was the closest to the starting position overall! fullRotation = true; - System.out.println("INFO:: Object " + this.thisObject.name + " has made a full rotation last round."); + if (SimulatorConfig.logConsole) { + System.out.println("INFO:: Object " + this.thisObject.name + " has made a full rotation last round."); + } } beforeLastStartDistance = lastStartDistance; @@ -300,6 +329,9 @@ public class ObjectProcessor { absoluteMax = new Node(); absoluteMin = new Node(); referenceZ = -1; + lastMaxRound = -1; + lastMinRound = -1; + skipNodes = false; } /** diff --git a/simulator/src/com/verictas/pos/simulator/processor/Processor.java b/simulator/src/com/verictas/pos/simulator/processor/Processor.java index a0ace51..4842313 100644 --- a/simulator/src/com/verictas/pos/simulator/processor/Processor.java +++ b/simulator/src/com/verictas/pos/simulator/processor/Processor.java @@ -8,6 +8,7 @@ import com.verictas.pos.simulator.dataWriter.WritingException; import com.verictas.pos.simulator.mathUtils.AOP; import com.verictas.pos.simulator.mathUtils.AU; +import java.util.ArrayList; import java.util.HashMap; public class Processor { @@ -15,6 +16,8 @@ public class Processor { public HashMap initialObjectValues = new HashMap<>(); public HashMap objects = new HashMap<>(); + public ArrayList arguments = new ArrayList<>(); + public Processor(Object[] objects) throws ProcessingException, WritingException { /** * Initialize DataWriter @@ -62,10 +65,10 @@ public class Processor { System.out.println("\n\n============== ROTATION DATA: " + objectName.toUpperCase() + ", ROUND " + (Simulator.round - 1) + " ============="); if (SimulatorConfig.outputUnit.equals("AU")) { - System.out.println("Current position (AU): " + AU.convertFromMeter(objects.get(objectName).position) + "\n"); - System.out.println("Highest point (z-axis graph) (AU): " + AU.convertFromMeter(object.absoluteMax)); - System.out.println("Lowest point (z-axis graph) (AU): " + AU.convertFromMeter(object.absoluteMin)); - System.out.println("Calculated reference height (AU) : " + AU.convertFromMeter(object.referenceZ) + "\n"); + //System.out.println("Current position (AU): " + AU.convertFromMeter(objects.get(objectName).position) + "\n"); + //System.out.println("Highest point (z-axis graph) (AU): " + AU.convertFromMeter(object.absoluteMax)); + //System.out.println("Lowest point (z-axis graph) (AU): " + AU.convertFromMeter(object.absoluteMin)); + //System.out.println("Calculated reference height (AU) : " + AU.convertFromMeter(object.referenceZ) + "\n"); if (object.ascendingNode != null) { System.out.println("Ascending node (AU): " + AU.convertFromMeter(object.ascendingNode)); @@ -79,15 +82,15 @@ public class Processor { System.out.println("WARNING:: Descending node not found.\n"); } - System.out.println("Position during apastron (AU): " + AU.convertFromMeter(object.aphelion)); + //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("Position during periastron (AU): " + AU.convertFromMeter(object.perihelion)); + //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"); } else { - System.out.println("Current position (m): " + objects.get(objectName).position + "\n"); - System.out.println("Highest point (z-axis graph) (m): " + object.absoluteMax); - System.out.println("Lowest point (z-axis graph) (m): " + object.absoluteMin); - System.out.println("Calculated reference height (m) : " + object.referenceZ + "\n"); + //System.out.println("Current position (m): " + objects.get(objectName).position + "\n"); + //System.out.println("Highest point (z-axis graph) (m): " + object.absoluteMax); + //System.out.println("Lowest point (z-axis graph) (m): " + object.absoluteMin); + //System.out.println("Calculated reference height (m) : " + object.referenceZ + "\n"); if (object.ascendingNode != null) { System.out.println("Ascending node (m): " + object.ascendingNode); @@ -101,15 +104,20 @@ public class Processor { System.out.println("WARNING:: Descending node not found.\n"); } - System.out.println("Position during apastron (m): " + object.aphelion); + //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("Position during periastron (m): " + object.perihelion); + //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"); } 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))); + + if (object.checkNodes()) { + arguments.add(Math.toDegrees(AOP.calculate(object.ascendingNode, object.perihelion, object.aphelion))); + } + } else { System.out.println("ERROR:: Can't calculate the argument of periapsis because the ascending node is missing."); } @@ -158,6 +166,18 @@ public class Processor { public void close() throws ProcessingException { try { this.writer.save(); + System.out.println("RESULTS: " + arguments); + + // 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: " + average); } catch(WritingException e) { throw new ProcessingException("An error occurred during creation of the file writer: " + e.toString()); }