MAKS_Enjoyer

I have been increminated of several war crimes in skibidi occupied new york

Nov 13th, 2022 (edited)
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 119.00 KB | Source Code | 0 0
  1. import java.io.*;
  2. import java.text.DecimalFormat;
  3. import java.time.*;
  4. import java.util.*;
  5. import java.nio.file.*;
  6. import org.apache.poi.xwpf.usermodel.*;
  7. import java.time.format.DateTimeFormatter;
  8.  
  9. class AutoEngineGen {
  10.     public static boolean MStringS(String[] strings, String tbc) {
  11.         boolean IsThere = false;
  12.         for (String s : strings) {
  13.             if (tbc.contains(s)) {
  14.                 IsThere = true;
  15.                 break;
  16.             }
  17.         }
  18.         return IsThere;
  19.     }
  20.     public static int rN (double add, int maxV){
  21.         return (int)(add + (Math.random() * maxV));
  22.     }
  23.     public static String rand(String[] array){
  24.         Collections.shuffle(Arrays.asList(array));
  25.         Random arrayChosen = new Random();
  26.         int arrayChosen_index = arrayChosen.nextInt(array.length);
  27.         return array[arrayChosen_index];
  28.     }
  29.     public static String[] split(String string, String sep) {
  30.         return string.split(sep);
  31.     }
  32.     public static int findex(String[] array, String searched){
  33.         ArrayList<String> clist = new ArrayList<>();
  34.         Collections.addAll(clist, array);
  35.         return clist.indexOf(searched);
  36.     }
  37.     public static boolean isHypergolic (String OCC, String FCC) {
  38.         boolean isHypergolic = false;
  39.         switch (OCC) {
  40.             case "N2O4 (Nitrogen Tetroxide)" -> {
  41.                 switch (FCC) {
  42.                     case "50% CH6N2 + 50% N2H4 (Aerosine-50)", "75% CH6N2 + 25% N2H4 (UH-25)", "C6H5NH2 (Aniline)" ,
  43.                             "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)" ->{
  44.                         isHypergolic = true;
  45.                     } default -> {
  46.                         isHypergolic = false;
  47.                     }
  48.                 }
  49.             } case "H2O2 (Hydrogen Peroxide) 95%", "H2O2 (Hydrogen Peroxide) 85%", "O2 (Oxygen)" -> {
  50.                 isHypergolic = false;
  51.             } case "O3 (Ozone)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)" -> {
  52.                 isHypergolic = true;
  53.             } case "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)",
  54.                     "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)",
  55.                     "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)" -> {
  56.                 switch (FCC) {
  57.                     case "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)" ->{
  58.                         isHypergolic = true;
  59.                     } default -> {
  60.                         isHypergolic = false;
  61.                     }
  62.                 }
  63.             }
  64.         }
  65.         return isHypergolic;
  66.     }
  67.     public static String propDataFind (String fuel, String oxid) {
  68.         String combust_temp = null, mixRatio = null, exhaustVel = null;
  69.         String[] fuel_List = new String[0];
  70.         int[] combustionTemps = new int[0], exhaustVels = new int[0];
  71.         double[] mixRatios = new double [0];
  72.         switch (oxid) {
  73.             case "O2 (Oxygen)" -> {
  74.                 fuel_List = new String[]{"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  75.                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  76.                         "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
  77.                 combustionTemps = new int[]{3304, 3379, 3314, 3167, 3657, 3020, 3399, 3275, 3214, 3526};
  78.                 mixRatios = new double[]{5.00, 2.77, 1.49, 1.29, 1.72, 1.28, 1.15, 0.74, 1.19, 2.29};
  79.                 exhaustVels = new int[]{3738, 2932, 2713, 2635, 2708, 2815, 2938, 2973, 2687, 2834};
  80.             }
  81.             case "F2 (Fluorine)" -> {
  82.                 fuel_List = new String[]{"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  83.                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)",
  84.                         "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
  85.                 combustionTemps = new int[]{3689, -1, -1, 4344, -1, 4469, -1, -1, 4544, 4402, -1};
  86.                 mixRatios = new double[]{6.00, -1.00, -1.00, 2.26, -1.00, 2.81, -1.00, -1.00, 1.82, 2.20, -1.00};
  87.                 exhaustVels = new int[]{3925, -1, -1, 3106, -1, 3278, -1, -1, 3315, 3146, -1};
  88.             }
  89.             case "F2 (Fluorine) + O2 (Oxygen)" -> {
  90.                 fuel_List = new String[]{"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  91.                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  92.                         "CH6N2 (MonomethylHydrazine)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)", "N2H4 (Hydrazine)"};
  93.                 combustionTemps = new int[]{-1, 4530, 4437, -1, 4517, 4584, 4575, 4583, -1, 4571, -1};
  94.                 mixRatios = new double[]{-1.00, 4.82, 2.56, -1.00, 2.41, 2.41, 2.22, 2.33, -1.00, 3.67, -1.00};
  95.                 exhaustVels = new int[]{-1, 3281, 3134, -1, 3006, 3255, 3273, 3264, -1, 3166, -1};
  96.             }
  97.             case "O3 (Ozone)" -> {
  98.                 fuel_List = new String[]{"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  99.                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  100.                         "CH6N2 (MonomethylHydrazine)", "C12H26 (n-Dodecane)", "CH3OH (Methanol)", "N2H4 (Hydrazine)",
  101.                         "NH3 (Ammonia)"};
  102.                 combustionTemps = new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
  103.                 mixRatios = new double[]{-1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00, -1.00};
  104.                 exhaustVels = new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
  105.             }
  106.             case "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)",
  107.                     "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)",
  108.                     "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)" -> {
  109.                 fuel_List = new String[]{"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  110.                         "CH3OH (Methanol)"};
  111.                 combustionTemps = new int[]{2795, 2905, 3033, 2932, 2824};
  112.                 mixRatios = new double[]{8.00, 2.75, 2.13, 1.28, 2.13};
  113.                 exhaustVels = new int[]{3112, 2449, 2635, 2702, 2441};
  114.             }
  115.             case "N2O4 (Nitrogen Tetroxide)" -> {
  116.                 fuel_List = new String[]{"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  117.                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  118.                         "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  119.                         "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
  120.                 combustionTemps = new int[]{2973, 3151, 3006, 3468, 3268, 3229, 3296, 3252, 3137, 3058, 3342};
  121.                 mixRatios = new double[]{6.50, 2.26, 1.93, 2.64, 1.85, 1.59, 2.10, 1.73, 1.08, 1.78, 3.53};
  122.                 exhaustVels = new int[]{3334, 2540, 2479, 2538, 2730, 2750, 2713, 2742, 2803, 2528, 2619};
  123.             }
  124.             case "H2O2 (Hydrogen Peroxide) 85%" -> {
  125.                 fuel_List = new String[]{"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  126.                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  127.                         "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  128.                         "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
  129.                 combustionTemps = new int[]{2544, 2552, 2447, 2719, 2681, 2668, 2690, 2681, 2630, 2511, 2666};
  130.                 mixRatios = new double[]{14.00, 4.62, 3.77, 5.95, 4.02, 3.39, 4.63, 3.76, 2.15, 3.55, 7.84};
  131.                 exhaustVels = new int[]{2882, 2476, 2425, 2495, 2592, 2604, 2582, 2600, 2642, 2464, 2530};
  132.             }
  133.             case "H2O2 (Hydrogen Peroxide) 95%" -> {
  134.                 fuel_List = new String[]{"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  135.                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  136.                         "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  137.                         "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
  138.                 combustionTemps = new int[]{2666, 2762, 2653, 2934, 2870, 2852, 2884, 2871, 2801, 2709, 2878};
  139.                 mixRatios = new double[]{11.00, 3.97, 3.27, 4.94, 3.32, 2.82, 3.82, 3.13, 1.82, 3.06, 6.50};
  140.                 exhaustVels = new int[]{1918, 1599, 1566, 1610, 1683, 1692, 1676, 1688, 1718, 1590, 1639};
  141.             }
  142.         }
  143.         int x = 0, b = 0;
  144.         try {
  145.             x = findex(fuel_List, fuel);
  146.             b++;
  147.             combust_temp = String.valueOf(combustionTemps[x]);
  148.             b++;
  149.             mixRatio = String.valueOf(mixRatios[x]);
  150.             b++;
  151.             exhaustVel = String.valueOf(exhaustVels[x]);
  152.             b++;
  153.         } catch(Exception e) {
  154.             System.out.println("Fuel selected index: " + x);
  155.             System.out.println("Error Line Number: " + b);
  156.             System.out.println("Chosen Oxidizer: " + oxid);
  157.             System.out.println("Chosen Fuel: " + fuel);
  158.             System.exit(1);
  159.         }
  160.         return combust_temp + ", " + mixRatio + ", " + exhaustVel;
  161.     }
  162.     public static String NzlParameters (String altitude_Of_Operation_Chosen) {
  163.         String nozzle_Type_Chosen = "", OExpansionRatio = "";
  164.         switch (altitude_Of_Operation_Chosen) {
  165.             case "0-20 km (Sea Level)" -> {
  166.                 String[] nozzle_Type_List_SL = {"Contour Bell Nozzle", "Parabolic Bell Nozzle", "Conical Nozzle",
  167.                         "Stepped Dual Bell Nozzle"};
  168.                 nozzle_Type_Chosen = rand(nozzle_Type_List_SL);
  169.                 if (nozzle_Type_Chosen.equalsIgnoreCase("Conical Nozzle")) {
  170.                     OExpansionRatio = rN(10, 9) + ":1";
  171.                 } else {
  172.                     OExpansionRatio = rN(10, 12) + ":1";
  173.                 }
  174.             } case "20-30 km (Medium Atmosphere)" -> {
  175.                 String[] nozzle_Type_List_HA = {"Contour Bell Nozzle", "Parabolic Bell Nozzle", "Stepped Dual Bell Nozzle"};
  176.                 nozzle_Type_Chosen = rand(nozzle_Type_List_HA);
  177.                 OExpansionRatio = rN(32, 14) + ":1";
  178.             } case "30-80 km (High Atmosphere)" -> {
  179.                 String[] nozzle_Type_List_HAi = {"Contour Bell Nozzle", "Parabolic Bell Nozzle", "Stepped Dual Bell Nozzle"};
  180.                 nozzle_Type_Chosen = rand(nozzle_Type_List_HAi);
  181.                 OExpansionRatio = rN(47, 43) + ":1";
  182.             } case "80 km+ (Vacuum)" -> {
  183.                 String[] nozzle_Type_List_VA = {"Contour Bell Nozzle", "Parabolic Bell Nozzle", "Expanding Nozzle"};
  184.                 nozzle_Type_Chosen = rand(nozzle_Type_List_VA);
  185.                 OExpansionRatio = rN(90, 110) + ":1";
  186.             } case "Any Altitude (0-80 km+)" -> {
  187.                 String[] nozzle_Type_List_Aero = {"Linear Aerospike Nozzle", "Toroidal Aerospike Nozzle",
  188.                         "Stepped Dual Bell Nozzle"};
  189.                 nozzle_Type_Chosen = rand(nozzle_Type_List_Aero);
  190.                 if (nozzle_Type_Chosen.equalsIgnoreCase("Stepped Dual Bell Nozzle")) {
  191.                     OExpansionRatio = rN(10, 9) + ":1";
  192.                 } else {
  193.                     OExpansionRatio = "None";
  194.                 }
  195.             }
  196.         }
  197.         return nozzle_Type_Chosen + ", " + OExpansionRatio;
  198.     }
  199.     public static void StndrdDet(String engine_Name, String engine_Cycle_Chosen, String oxidizer_Chosen, String fuel_Chosen,
  200.                                 String[] tank_Repressurisation, String[] altitude_Of_Operation) throws IOException {
  201.         String[] Eng_Data = split(propDataFind(fuel_Chosen, oxidizer_Chosen), ", ");
  202.         String combust_temp = Eng_Data[0];
  203.         String mixRatio = Eng_Data[1];
  204.         String exhaustVel = Eng_Data[2];
  205.  
  206.         String altitude_Of_Operation_Chosen = rand(altitude_Of_Operation);
  207.         String[] NzlData = split(NzlParameters(altitude_Of_Operation_Chosen), ", ");
  208.         String nozzle_Type_Chosen = NzlData[0];
  209.         String AreaRatio = NzlData[1];
  210.  
  211.         String tank_Repressurisation_Chosen = rand(tank_Repressurisation);
  212.         boolean isHypergolic = isHypergolic(oxidizer_Chosen, fuel_Chosen);
  213.         boolean isCryogenic = isCryogenic(oxidizer_Chosen, fuel_Chosen);
  214.         String purpose = uses(isHypergolic, isCryogenic, altitude_Of_Operation_Chosen, engine_Cycle_Chosen);
  215.         String[] search_for = {"Upper", "Payload", "Space"}, cooling_mechanism;
  216.         boolean longDur = MStringS(search_for, purpose);
  217.         if (longDur) {
  218.             cooling_mechanism = new String[]{"Radiative Cooling", "Dump Cooling", "Film Cooling", "Regenerative Cooling",
  219.                     "Transpiration Cooling"};
  220.         } else {
  221.             cooling_mechanism = new String[]{"Ablative Cooling", "Radiative Cooling", "Dump Cooling", "Film Cooling",
  222.                     "Regenerative Cooling", "Transpiration Cooling"};
  223.         }
  224.         String cooling_Mechanism_Chosen = rand(cooling_mechanism);
  225.         String f_regen = "";
  226.         if (cooling_Mechanism_Chosen.equals("Regenerative Cooling")) {
  227.             int choice = (rN(4, 63))/2;
  228.             if (Math.ceil(choice) == Math.floor(choice)) {
  229.                 f_regen = "Fuel ";
  230.             } else {
  231.                 f_regen = "Oxidizer ";
  232.             }
  233.         }
  234.         String cooling_Mechanism_C = f_regen + cooling_Mechanism_Chosen;
  235.         String injector = Injector(cooling_Mechanism_C, engine_Cycle_Chosen);
  236.         output_def(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen, altitude_Of_Operation_Chosen,
  237.                 nozzle_Type_Chosen, tank_Repressurisation_Chosen, cooling_Mechanism_C, isHypergolic, isCryogenic,
  238.                 purpose, injector, AreaRatio, combust_temp, mixRatio, exhaustVel);
  239.     }
  240.     public static boolean isCryogenic(String oxidizer_chosen, String fuel_chosen) {
  241.         boolean isCryo = false;
  242.         switch (oxidizer_chosen) {
  243.             case "O3 (Ozone)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O2 (Oxygen)" -> {
  244.                 isCryo = true;
  245.             }
  246.         }
  247.         switch (fuel_chosen) {
  248.             case "CH3OH (Methanol)", "C12H26 (n-Dodecane)", "H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  249.                     "NH3 (Ammonia)", "CH4 (Methane)" -> {
  250.                 isCryo = true;
  251.             }
  252.         }
  253.         return isCryo;
  254.     }
  255.     public static String uses(boolean isHypergolic, boolean isCryogenic, String alt, String En_Cycle) {
  256.         String use = "";
  257.         String[] pot_uses;
  258.         boolean complex = En_Cycle.contains("Combustion Tap") || En_Cycle.contains("Staged") || En_Cycle.contains("Full Flow");
  259.         if ((alt.equals("0-10 km (Sea Level)")) || (alt.equals("20-30 km (Medium Atmosphere)"))) {
  260.             if (complex) {
  261.                 pot_uses = new String[]{"Lower Stage (Main Propulsion)"};
  262.             } else {
  263.                 pot_uses = new String[]{"Lower Stage (Main Propulsion)", "Lower Stage (Course Correction)", "Lower Stage (Vernier)"};
  264.             }
  265.             use = rand(pot_uses);
  266.         } else if ((alt.equals("30-80 km (High Atmosphere)")) || (alt.equals("80 km+ (Vacuum)"))) {
  267.             if (isHypergolic && isCryogenic) {
  268.                 if (complex) {
  269.                     pot_uses = new String[]{"Upper Stage (Main Propulsion)"};
  270.                 } else {
  271.                     pot_uses = new String[]{"Upper Stage(Main Propulsion)", "Upper Stage(Course Correction)",
  272.                             "Upper Stage(Vernier)", "Upper Stage (Ullage)", "Payload (Main Propulsion)", "Payload (ACS)"};
  273.                 }
  274.                 use = rand(pot_uses);
  275.             } else if (!isHypergolic && isCryogenic) {
  276.                 if (complex) {
  277.                     pot_uses = new String[]{"Upper Stage (Main Propulsion)"};
  278.                 } else {
  279.                     pot_uses = new String[]{"Upper Stage (Main Propulsion)", "Upper Stage (Vernier)"};
  280.                 }
  281.                 use = rand(pot_uses);
  282.             } else if (isHypergolic && !isCryogenic) {
  283.                 if (complex) {
  284.                     pot_uses = new String[]{"Upper Stage(Main Propulsion)", "Payload (Main Propulsion)",
  285.                             "Space Tug (Main Propulsion)"};
  286.                 } else {
  287.                     pot_uses = new String[]{"Upper Stage(Main Propulsion)", "Upper Stage(Course Correction)",
  288.                             "Upper Stage(Vernier)", "Upper Stage (Ullage)", "Payload (Main Propulsion)",
  289.                             "Payload (ACS)", "Payload (Course Correction)", "Payload (Vernier)",
  290.                             "Space Tug (Main Propulsion)", "Space Tug (Course Correction)", "Space Tug (Vernier)",
  291.                             "Space Tug (Ullage)"};
  292.                 }
  293.                 use = rand(pot_uses);
  294.             }
  295.         } else {
  296.             pot_uses = new String[]{"Lower Stage (Main Propulsion)", "Upper Stage(Main Propulsion)", "Payload (Main Propulsion)"};
  297.             use = rand(pot_uses);
  298.         }
  299.         return use;
  300.     }
  301.     public static String Injector(String cooling_Mechanism, String engine_Cycle_Chosen) {
  302.         String fuel_state = "Liquid";
  303.         if (cooling_Mechanism.contains("Regenerative Cooling") || engine_Cycle_Chosen.contains("Expander")) {
  304.             fuel_state = "Gas";
  305.         }
  306.         String[] injector = {"Showerhead Injector", "Self-impinging Injector", "Cross-impinging Injector",
  307.                 "Swirl Injector", "Pintle Injector"};
  308.         return fuel_state + " " + rand(injector);
  309.     }
  310.     public static String nameGen(String[] engine_Name1, String[] firstPart) {
  311.         String engine_Name;
  312.         Collections.shuffle(Arrays.asList(engine_Name1));
  313.         Collections.shuffle(Arrays.asList(firstPart));
  314.         Random engineNameChosen = new Random();
  315.         Random firstPartC = new Random();
  316.         int engineNameChosen_index = engineNameChosen.nextInt(engine_Name1.length);
  317.         int firstPart_index = firstPartC.nextInt(firstPart.length);
  318.         String engNameFinalf = " " + engine_Name1[engineNameChosen_index];
  319.         String firstPart_f = firstPart[firstPart_index] + "-";
  320.         int finalNumber = rN(12, 999);
  321.         if (finalNumber % 8 == 0) {
  322.             engine_Name = firstPart_f + finalNumber + engNameFinalf;
  323.         } else {
  324.             char randomizedCharacter;
  325.             int uio93 = rN(1, 999);
  326.             int uio94 = rN(1, 11);
  327.             Random randomLetter = new Random();
  328.             if (uio93 % uio94 == 0) {
  329.                 randomizedCharacter = (char) (randomLetter.nextInt(26) + 'a');
  330.                 while (randomizedCharacter != 'l' || randomizedCharacter == 'o' || randomizedCharacter == 'i' || randomizedCharacter == 'q' || randomizedCharacter == 'e' || randomizedCharacter == 'h' || randomizedCharacter == 'g' || randomizedCharacter == 'c' || randomizedCharacter == 'j') {
  331.                     randomizedCharacter = (char) (randomLetter.nextInt(26) + 'a');
  332.                     if (randomizedCharacter != 'l' && randomizedCharacter != 'o' && randomizedCharacter != 'i' && randomizedCharacter != 'q' && randomizedCharacter != 'e' && randomizedCharacter != 'h' && randomizedCharacter != 'g' && randomizedCharacter != 'c' && randomizedCharacter != 'j') {
  333.                         break;
  334.                     }
  335.                 }
  336.             } else {
  337.                 randomizedCharacter = (char) (randomLetter.nextInt(26) + 'A');
  338.                 while (randomizedCharacter == 'O' || randomizedCharacter == 'I' || randomizedCharacter == 'Q') {
  339.                     randomizedCharacter = (char) (randomLetter.nextInt(26) + 'A');
  340.                     if (randomizedCharacter == 'O' || randomizedCharacter == 'I' || randomizedCharacter == 'Q') {
  341.                         break;
  342.                     }
  343.                 }
  344.             }
  345.             engine_Name = firstPart_f + finalNumber + randomizedCharacter + engNameFinalf;
  346.         }
  347.         return engine_Name;
  348.     }
  349.     public static void output_monod(String ENN, String ECC, String AOOC, String PLC, String NTLC, String CMC, String CCC, String purpose) throws IOException {
  350.         String lbrk = "======================================================================================================================";
  351.         File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
  352.         System.out.println(lbrk + '\n' + "Engine Designation: " + ENN + '\n');
  353.         System.out.println("Fuel Flow Cycle: " + ECC);
  354.         System.out.println("Propellant: " + PLC);
  355.         System.out.println("Altitude Of Operation: " + AOOC);
  356.         System.out.println("Exhaust Nozzle Geometry: " + NTLC);
  357.         System.out.println("Engine Use Case: " + purpose);
  358.         System.out.println("Nozzle Cooling Mechanism: " + CMC);
  359.         System.out.println("Propellant catalyst: " + CCC + '\n');
  360.         XWPFDocument docx = new XWPFDocument();
  361.         if (new File(String.valueOf(pathn1)).exists()) {
  362.             FileInputStream jesus = new FileInputStream(String.valueOf(pathn1));
  363.             docx = new XWPFDocument(jesus);
  364.         }
  365.         XWPFParagraph par = docx.createParagraph();
  366.         XWPFRun run = par.createRun();
  367.         run.setFontSize(12);
  368.         run.setBold(true);
  369.         run.setFontFamily("Arial");
  370.         run.setText("Engine Designation: ");
  371.         run.setTextPosition(15);
  372.         XWPFRun run2 = par.createRun();
  373.         run2.setFontSize(12);
  374.         run2.setBold(true);
  375.         run2.setFontFamily("Arial");
  376.         run2.setText(ENN);
  377.         run2.setTextPosition(15);
  378.         run2.addBreak();
  379.         // -----------------------------------------------------------
  380.         XWPFRun run3 = par.createRun();
  381.         run3.setFontSize(10);
  382.         run3.setBold(true);
  383.         run3.setFontFamily("Arial");
  384.         run3.setText("Fuel Flow Cycle: ");
  385.         XWPFRun run4 = par.createRun();
  386.         run4.setFontSize(10);
  387.         run4.setFontFamily("Arial");
  388.         run4.setText(ECC);
  389.         run4.addBreak();
  390.         // -----------------------------------------------------------
  391.         XWPFRun run5 = par.createRun();
  392.         run5.setFontSize(10);
  393.         run5.setBold(true);
  394.         run5.setFontFamily("Arial");
  395.         run5.setText("Propellant(Remass): ");
  396.         XWPFRun run6 = par.createRun();
  397.         run6.setFontSize(10);
  398.         run6.setFontFamily("Arial");
  399.         run6.setText(PLC);
  400.         run6.addBreak();
  401.         // -----------------------------------------------------------
  402.         XWPFRun run9 = par.createRun();
  403.         run9.setFontSize(10);
  404.         run9.setBold(true);
  405.         run9.setFontFamily("Arial");
  406.         run9.setText("Exhaust Nozzle Geometry: ");
  407.         XWPFRun run0 = par.createRun();
  408.         run0.setFontSize(10);
  409.         run0.setFontFamily("Arial");
  410.         run0.setText(NTLC);
  411.         run0.addBreak();
  412.         // -----------------------------------------------------------
  413.         XWPFRun run104 = par.createRun();
  414.         run104.setFontSize(10);
  415.         run104.setBold(true);
  416.         run104.setFontFamily("Arial");
  417.         run104.setText("Engine Use Case: ");
  418.         XWPFRun run105 = par.createRun();
  419.         run105.setFontSize(10);
  420.         run105.setFontFamily("Arial");
  421.         run105.setText(purpose);
  422.         run105.addBreak();
  423.         // -----------------------------------------------------------
  424.         XWPFRun run10 = par.createRun();
  425.         run10.setFontSize(10);
  426.         run10.setBold(true);
  427.         run10.setFontFamily("Arial");
  428.         run10.setText("Altitude Of Operation: ");
  429.         XWPFRun run23 = par.createRun();
  430.         run23.setFontSize(10);
  431.         run23.setFontFamily("Arial");
  432.         run23.setText(AOOC);
  433.         run23.addBreak();
  434.         // -----------------------------------------------------------
  435.         XWPFRun run13 = par.createRun();
  436.         run13.setFontSize(10);
  437.         run13.setBold(true);
  438.         run13.setFontFamily("Arial");
  439.         run13.setText("Nozzle Cooling Mechanism: ");
  440.         XWPFRun run14 = par.createRun();
  441.         run14.setFontSize(10);
  442.         run14.setFontFamily("Arial");
  443.         run14.setText(CMC);
  444.         run14.addBreak();
  445.         // -----------------------------------------------------------
  446.         XWPFRun run15 = par.createRun();
  447.         run15.setFontSize(10);
  448.         run15.setBold(true);
  449.         run15.setFontFamily("Arial");
  450.         run15.setText("Engine catalyst: ");
  451.         XWPFRun run16 = par.createRun();
  452.         run16.setFontSize(10);
  453.         run16.setFontFamily("Arial");
  454.         run16.setText(CCC);
  455.         run16.addBreak();
  456.         run16.addBreak();
  457.         // -----------------------------------------------------------
  458.         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  459.             docx.write(out);
  460.         }
  461.     }
  462.     public static void output_mono(String ENN, String ECC, String AOOC, String PLC, String NTLC, String CMC, String purpose) throws IOException {
  463.         String lbrk = "======================================================================================================================";
  464.         File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
  465.         System.out.println(lbrk + '\n' + "Engine Designation: " + ENN + '\n');
  466.         System.out.println("Fuel Flow Cycle: " + ECC);
  467.         System.out.println("Propellant: " + PLC);
  468.         System.out.println("Altitude Of Operation: " + AOOC);
  469.         System.out.println("Exhaust Nozzle Geometry: " + NTLC);
  470.         System.out.println("Engine Use Case: " + purpose);
  471.         System.out.println("Nozzle Cooling Mechanism: " + CMC + '\n');
  472.         XWPFDocument docx = new XWPFDocument();
  473.         if (new File(String.valueOf(pathn1)).exists()) {
  474.             FileInputStream jesus = new FileInputStream(String.valueOf(pathn1));
  475.             docx = new XWPFDocument(jesus);
  476.         }
  477.         XWPFParagraph par = docx.createParagraph();
  478.         XWPFRun run = par.createRun();
  479.         run.setFontSize(12);
  480.         run.setBold(true);
  481.         run.setFontFamily("Arial");
  482.         run.setText("Engine Designation: ");
  483.         run.setTextPosition(15);
  484.         XWPFRun run2 = par.createRun();
  485.         run2.setFontSize(12);
  486.         run2.setBold(true);
  487.         run2.setFontFamily("Arial");
  488.         run2.setText(ENN);
  489.         run2.setTextPosition(15);
  490.         run2.addBreak();
  491.         // -----------------------------------------------------------
  492.         XWPFRun run3 = par.createRun();
  493.         run3.setFontSize(10);
  494.         run3.setBold(true);
  495.         run3.setFontFamily("Arial");
  496.         run3.setText("Fuel Flow Cycle: ");
  497.         XWPFRun run4 = par.createRun();
  498.         run4.setFontSize(10);
  499.         run4.setFontFamily("Arial");
  500.         run4.setText(ECC);
  501.         run4.addBreak();
  502.         // -----------------------------------------------------------
  503.         XWPFRun run5 = par.createRun();
  504.         run5.setFontSize(10);
  505.         run5.setBold(true);
  506.         run5.setFontFamily("Arial");
  507.         run5.setText("Propellant(Remass): ");
  508.         XWPFRun run6 = par.createRun();
  509.         run6.setFontSize(10);
  510.         run6.setFontFamily("Arial");
  511.         run6.setText(PLC);
  512.         run6.addBreak();
  513.         // -----------------------------------------------------------
  514.         XWPFRun run9 = par.createRun();
  515.         run9.setFontSize(10);
  516.         run9.setBold(true);
  517.         run9.setFontFamily("Arial");
  518.         run9.setText("Exhaust Nozzle Geometry: ");
  519.         XWPFRun run0 = par.createRun();
  520.         run0.setFontSize(10);
  521.         run0.setFontFamily("Arial");
  522.         run0.setText(NTLC);
  523.         run0.addBreak();
  524.         // -----------------------------------------------------------
  525.         XWPFRun run104 = par.createRun();
  526.         run104.setFontSize(10);
  527.         run104.setBold(true);
  528.         run104.setFontFamily("Arial");
  529.         run104.setText("Engine Use Case: ");
  530.         XWPFRun run105 = par.createRun();
  531.         run105.setFontSize(10);
  532.         run105.setFontFamily("Arial");
  533.         run105.setText(purpose);
  534.         run105.addBreak();
  535.         // -----------------------------------------------------------
  536.         XWPFRun run10 = par.createRun();
  537.         run10.setFontSize(10);
  538.         run10.setBold(true);
  539.         run10.setFontFamily("Arial");
  540.         run10.setText("Altitude Of Operation: ");
  541.         XWPFRun run23 = par.createRun();
  542.         run23.setFontSize(10);
  543.         run23.setFontFamily("Arial");
  544.         run23.setText(AOOC);
  545.         run23.addBreak();
  546.         // -----------------------------------------------------------
  547.         XWPFRun run13 = par.createRun();
  548.         run13.setFontSize(10);
  549.         run13.setBold(true);
  550.         run13.setFontFamily("Arial");
  551.         run13.setText("Nozzle Cooling Mechanism: ");
  552.         XWPFRun run14 = par.createRun();
  553.         run14.setFontSize(10);
  554.         run14.setFontFamily("Arial");
  555.         run14.setText(CMC);
  556.         run14.addBreak();
  557.         run14.addBreak();
  558.         // -----------------------------------------------------------
  559.         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  560.             docx.write(out);
  561.         }
  562.     }
  563.     public static void output_et(String ENN, String ECC, String AOOC, String PLC, String NTLC, String PGLC, String purpose) throws IOException {
  564.         String lbrk = "======================================================================================================================";
  565.         File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
  566.         String pwr = (Math.round((float)rN(20, 980)/10))*10 + " kW" + '\n';
  567.         System.out.println(lbrk + '\n' + "Engine Designation: " + ENN + '\n');
  568.         System.out.println("Fuel Flow Cycle: " + ECC);
  569.         System.out.println("Propellant(Remass): " + PLC);
  570.         System.out.println("Altitude Of Operation: " + AOOC);
  571.         System.out.println("Exhaust Nozzle Geometry: " + NTLC);
  572.         System.out.println("Engine Use Case: " + purpose);
  573.         System.out.println("Engine Power Source: " + PGLC);
  574.         System.out.println("Rated Power Level: " + pwr);
  575.  
  576.         XWPFDocument docx = new XWPFDocument();
  577.         if (new File(String.valueOf(pathn1)).exists()) {
  578.             FileInputStream jesus = new FileInputStream(String.valueOf(pathn1));
  579.             docx = new XWPFDocument(jesus);
  580.         }
  581.         XWPFParagraph par = docx.createParagraph();
  582.         XWPFRun run = par.createRun();
  583.         run.setFontSize(12);
  584.         run.setBold(true);
  585.         run.setFontFamily("Arial");
  586.         run.setText("Engine Designation: ");
  587.         run.setTextPosition(15);
  588.         XWPFRun run2 = par.createRun();
  589.         run2.setFontSize(12);
  590.         run2.setBold(true);
  591.         run2.setFontFamily("Arial");
  592.         run2.setText(ENN);
  593.         run2.setTextPosition(15);
  594.         run2.addBreak();
  595.         // -----------------------------------------------------------
  596.         XWPFRun run3 = par.createRun();
  597.         run3.setFontSize(10);
  598.         run3.setBold(true);
  599.         run3.setFontFamily("Arial");
  600.         run3.setText("Fuel Flow Cycle: ");
  601.         XWPFRun run4 = par.createRun();
  602.         run4.setFontSize(10);
  603.         run4.setFontFamily("Arial");
  604.         run4.setText(ECC);
  605.         run4.addBreak();
  606.         // -----------------------------------------------------------
  607.         XWPFRun run5 = par.createRun();
  608.         run5.setFontSize(10);
  609.         run5.setBold(true);
  610.         run5.setFontFamily("Arial");
  611.         run5.setText("Propellant(Remass): ");
  612.         XWPFRun run6 = par.createRun();
  613.         run6.setFontSize(10);
  614.         run6.setFontFamily("Arial");
  615.         run6.setText(PLC);
  616.         run6.addBreak();
  617.         // -----------------------------------------------------------
  618.         XWPFRun run9 = par.createRun();
  619.         run9.setFontSize(10);
  620.         run9.setBold(true);
  621.         run9.setFontFamily("Arial");
  622.         run9.setText("Exhaust Nozzle Geometry: ");
  623.         XWPFRun run0 = par.createRun();
  624.         run0.setFontSize(10);
  625.         run0.setFontFamily("Arial");
  626.         run0.setText(NTLC);
  627.         run0.addBreak();
  628.         // -----------------------------------------------------------
  629.         XWPFRun run104 = par.createRun();
  630.         run104.setFontSize(10);
  631.         run104.setBold(true);
  632.         run104.setFontFamily("Arial");
  633.         run104.setText("Engine Use Case: ");
  634.         XWPFRun run105 = par.createRun();
  635.         run105.setFontSize(10);
  636.         run105.setFontFamily("Arial");
  637.         run105.setText(purpose);
  638.         run105.addBreak();
  639.         // -----------------------------------------------------------
  640.         XWPFRun run10 = par.createRun();
  641.         run10.setFontSize(10);
  642.         run10.setBold(true);
  643.         run10.setFontFamily("Arial");
  644.         run10.setText("Altitude Of Operation: ");
  645.         XWPFRun run23 = par.createRun();
  646.         run23.setFontSize(10);
  647.         run23.setFontFamily("Arial");
  648.         run23.setText(AOOC);
  649.         run23.addBreak();
  650.         // -----------------------------------------------------------
  651.         XWPFRun run11 = par.createRun();
  652.         run11.setFontSize(10);
  653.         run11.setBold(true);
  654.         run11.setFontFamily("Arial");
  655.         run11.setText("Engine Power Source: ");
  656.         XWPFRun run12 = par.createRun();
  657.         run12.setFontSize(10);
  658.         run12.setFontFamily("Arial");
  659.         run12.setText(PGLC);
  660.         run12.addBreak();
  661.         // -----------------------------------------------------------
  662.         XWPFRun run13 = par.createRun();
  663.         run13.setFontSize(10);
  664.         run13.setBold(true);
  665.         run13.setFontFamily("Arial");
  666.         run13.setText("Rated Power Level: ");
  667.         XWPFRun run14 = par.createRun();
  668.         run14.setFontSize(10);
  669.         run14.setFontFamily("Arial");
  670.         run14.setText(pwr);
  671.         run14.addBreak();
  672.         run14.addBreak();
  673.         // -----------------------------------------------------------
  674.         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  675.             docx.write(out);
  676.         }
  677.     }
  678.     public static void output_nt(String ENN, String ECC, String AOOC, String NCC, String PLC, String RFC, String NTLC,
  679.                                  double EEV, String TRC, String CMC, String purpose, String react_gen, boolean bimodal, String ERC,
  680.                                  String PRS, String ARR, int ECT) throws IOException {
  681.         DecimalFormat f = new DecimalFormat("###,###,###");
  682.         String lbrk = "======================================================================================================================";
  683.         File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
  684.         String bimm1, bimm2, oo1, oo2;
  685.         if (!bimodal || ECC.equals("Nuclear SaltWater")) {
  686.             bimm1 = "Engine Bimodality: ";
  687.             oo1 = "Engine isn't bimodal";
  688.             bimm2 = "Engine Electrical Output: ";
  689.             oo2 = "None";
  690.         } else {
  691.             bimm1 = "Engine Bimodality: ";
  692.             oo1 = "Engine is bimodal";
  693.             bimm2 = "Engine Electrical Output: ";
  694.             double ops = ((double)ECT/100)*18;
  695.             oo2 = f.format(ops);
  696.             oo2 = oo2  + " MW";
  697.         }
  698.         double bruh = (((double)ECT/90)*100)/1000;
  699.         //============================================================================================
  700.         System.out.println(lbrk + '\n' + "Engine Designation: " + ENN + '\n');
  701.         if (!ECC.equals("Nuclear SaltWater") || !ECC.equals("Radioisotope Engine") || !NCC.equals("")) {
  702.             System.out.println("Fuel Flow Cycle: " + NCC + " " + ECC);
  703.         } else {
  704.             System.out.println("Fuel Flow Cycle: " + ECC);
  705.         }
  706.         System.out.println("Propellant (Remass): " + PLC);
  707.         System.out.println("Propellant State: " + PRS);
  708.         System.out.println("Reactor Generation: " + react_gen);
  709.         System.out.println("Reactor Maximum Power: " + f.format(bruh) + " GW");
  710.         System.out.println("Reactor Fuel Material: " + RFC);
  711.         if (NCC.equals("LANTR")) {
  712.             System.out.println("Engine Exhaust Velocity: " + "(" + f.format(EEV) + "/~" + 3850 + ")" + " m/s");
  713.         } else {
  714.             System.out.println("Engine Exhaust Velocity: " + f.format(EEV) + " m/s");
  715.         }
  716.         System.out.println("Reactor Core Temperature: " + f.format(ECT) + "°K");
  717.         System.out.println("Reactor Coolant: " + ERC);
  718.         System.out.println(bimm1 + oo1);
  719.         System.out.println(bimm2 + oo2);
  720.         System.out.println("Altitude Of Operation: " + AOOC);
  721.         System.out.println("Exhaust Nozzle Geometry: " + NTLC);
  722.         System.out.println("Exhaust Nozzle Area Ratio: " + ARR);
  723.         System.out.println("Exhaust Nozzle Cooling Mechanism: " + CMC);
  724.         System.out.println("Engine Use Case: " + purpose);
  725.         System.out.println("Tank repressurisation Method: " + TRC + '\n');
  726.         //============================================================================================
  727.         XWPFDocument docx = new XWPFDocument();
  728.         if (new File(String.valueOf(pathn1)).exists()) {
  729.             FileInputStream jesus = new FileInputStream(String.valueOf(pathn1));
  730.             docx = new XWPFDocument(jesus);
  731.         }
  732.         XWPFParagraph par = docx.createParagraph();
  733.         XWPFRun run = par.createRun();
  734.         run.setFontSize(12);
  735.         run.setBold(true);
  736.         run.setFontFamily("Arial");
  737.         run.setText("Engine Designation: ");
  738.         run.setTextPosition(15);
  739.         XWPFRun run2 = par.createRun();
  740.         run2.setFontSize(12);
  741.         run2.setBold(true);
  742.         run2.setFontFamily("Arial");
  743.         run2.setText(ENN);
  744.         run2.setTextPosition(15);
  745.         run2.addBreak();
  746.         // -----------------------------------------------------------
  747.         XWPFRun run3 = par.createRun();
  748.         run3.setFontSize(10);
  749.         run3.setBold(true);
  750.         run3.setFontFamily("Arial");
  751.         run3.setText("Fuel Flow Cycle: ");
  752.         XWPFRun run4 = par.createRun();
  753.         run4.setFontSize(10);
  754.         run4.setFontFamily("Arial");
  755.         if (ECC.equals("Nuclear SaltWater") || ECC.equals("Radioisotope Engine") || !NCC.equals("")) {
  756.             run4.setText(ECC);
  757.         } else {
  758.             run4.setText(NCC + " " + ECC);
  759.         }
  760.         run4.addBreak();
  761.         // -----------------------------------------------------------
  762.         XWPFRun run5 = par.createRun();
  763.         run5.setFontSize(10);
  764.         run5.setBold(true);
  765.         run5.setFontFamily("Arial");
  766.         run5.setText("Propellant(Remass): ");
  767.         XWPFRun run6 = par.createRun();
  768.         run6.setFontSize(10);
  769.         run6.setFontFamily("Arial");
  770.         run6.setText(PLC);
  771.         run6.addBreak();
  772.         // -----------------------------------------------------------
  773.         XWPFRun run65 = par.createRun();
  774.         run65.setFontSize(10);
  775.         run65.setBold(true);
  776.         run65.setFontFamily("Arial");
  777.         run65.setText("Propellant State: ");
  778.         XWPFRun run66 = par.createRun();
  779.         run66.setFontSize(10);
  780.         run66.setFontFamily("Arial");
  781.         run66.setText(PRS);
  782.         run66.addBreak();
  783.         // -----------------------------------------------------------
  784.         XWPFRun run767 = par.createRun();
  785.         run767.setFontSize(10);
  786.         run767.setBold(true);
  787.         run767.setFontFamily("Arial");
  788.         run767.setText("Reactor Generation: ");
  789.         XWPFRun run768 = par.createRun();
  790.         run768.setFontSize(10);
  791.         run768.setFontFamily("Arial");
  792.         run768.setText(react_gen);
  793.         run768.addBreak();
  794.         // -----------------------------------------------------------
  795.         XWPFRun run7 = par.createRun();
  796.         run7.setFontSize(10);
  797.         run7.setBold(true);
  798.         run7.setFontFamily("Arial");
  799.         run7.setText("Reactor Fuel Material: ");
  800.         XWPFRun run8 = par.createRun();
  801.         run8.setFontSize(10);
  802.         run8.setFontFamily("Arial");
  803.         run8.setText(RFC);
  804.         run8.addBreak();
  805.         // -----------------------------------------------------------
  806.         XWPFRun run777 = par.createRun();
  807.         run777.setFontSize(10);
  808.         run777.setBold(true);
  809.         run777.setFontFamily("Arial");
  810.         run777.setText("Engine Exhaust velocity: ");
  811.         XWPFRun run778 = par.createRun();
  812.         run778.setFontSize(10);
  813.         run778.setFontFamily("Arial");
  814.         if (NCC.equals("LANTR")) {
  815.             run778.setText("(" + f.format(EEV) + "/~" + 3850 + ")" + " m/s");
  816.         } else {
  817.             run778.setText(f.format(EEV) + " m/s");
  818.         }
  819.         run778.addBreak();
  820.         // -----------------------------------------------------------
  821.         XWPFRun run7767 = par.createRun();
  822.         run7767.setFontSize(10);
  823.         run7767.setBold(true);
  824.         run7767.setFontFamily("Arial");
  825.         run7767.setText("Reactor Core Temperature: ");
  826.         XWPFRun run7768 = par.createRun();
  827.         run7768.setFontSize(10);
  828.         run7768.setFontFamily("Arial");
  829.         run7768.setText(f.format(ECT) + " °K");
  830.         run7768.addBreak();
  831.         // -----------------------------------------------------------
  832.         XWPFRun run566 = par.createRun();
  833.         run566.setFontSize(10);
  834.         run566.setBold(true);
  835.         run566.setFontFamily("Arial");
  836.         run566.setText("Reactor Coolant: ");
  837.         XWPFRun run567 = par.createRun();
  838.         run567.setFontSize(10);
  839.         run567.setFontFamily("Arial");
  840.         run567.setText(ERC);
  841.         run567.addBreak();
  842.         // -----------------------------------------------------------
  843.         XWPFRun run769 = par.createRun();
  844.         run769.setFontSize(10);
  845.         run769.setBold(true);
  846.         run769.setFontFamily("Arial");
  847.         run769.setText(bimm1);
  848.         XWPFRun run770 = par.createRun();
  849.         run770.setFontSize(10);
  850.         run770.setFontFamily("Arial");
  851.         run770.setText(oo1);
  852.         run770.addBreak();
  853.         // -----------------------------------------------------------
  854.         XWPFRun run771 = par.createRun();
  855.         run771.setFontSize(10);
  856.         run771.setBold(true);
  857.         run771.setFontFamily("Arial");
  858.         run771.setText(bimm2);
  859.         XWPFRun run772 = par.createRun();
  860.         run772.setFontSize(10);
  861.         run772.setFontFamily("Arial");
  862.         run772.setText(oo2);
  863.         run772.addBreak();
  864.         // -----------------------------------------------------------
  865.         XWPFRun run10 = par.createRun();
  866.         run10.setFontSize(10);
  867.         run10.setBold(true);
  868.         run10.setFontFamily("Arial");
  869.         run10.setText("Altitude Of Operation: ");
  870.         XWPFRun run23 = par.createRun();
  871.         run23.setFontSize(10);
  872.         run23.setFontFamily("Arial");
  873.         run23.setText(AOOC);
  874.         run23.addBreak();
  875.         // -----------------------------------------------------------
  876.         XWPFRun run9 = par.createRun();
  877.         run9.setFontSize(10);
  878.         run9.setBold(true);
  879.         run9.setFontFamily("Arial");
  880.         run9.setText("Exhaust Nozzle Geometry: ");
  881.         XWPFRun run0 = par.createRun();
  882.         run0.setFontSize(10);
  883.         run0.setFontFamily("Arial");
  884.         run0.setText(NTLC);
  885.         run0.addBreak();
  886.         // -----------------------------------------------------------
  887.         XWPFRun run69 = par.createRun();
  888.         run69.setFontSize(10);
  889.         run69.setBold(true);
  890.         run69.setFontFamily("Arial");
  891.         run69.setText("Exhaust Nozzle Area Ratio: ");
  892.         XWPFRun run60 = par.createRun();
  893.         run60.setFontSize(10);
  894.         run60.setFontFamily("Arial");
  895.         run60.setText(ARR);
  896.         run60.addBreak();
  897.         // -----------------------------------------------------------
  898.         XWPFRun run13 = par.createRun();
  899.         run13.setFontSize(10);
  900.         run13.setBold(true);
  901.         run13.setFontFamily("Arial");
  902.         run13.setText("Exhaust Nozzle Cooling Mechanism: ");
  903.         XWPFRun run14 = par.createRun();
  904.         run14.setFontSize(10);
  905.         run14.setFontFamily("Arial");
  906.         run14.setText(CMC);
  907.         run14.addBreak();
  908.         // -----------------------------------------------------------
  909.         XWPFRun run104 = par.createRun();
  910.         run104.setFontSize(10);
  911.         run104.setBold(true);
  912.         run104.setFontFamily("Arial");
  913.         run104.setText("Engine Use Case: ");
  914.         XWPFRun run105 = par.createRun();
  915.         run105.setFontSize(10);
  916.         run105.setFontFamily("Arial");
  917.         run105.setText(purpose);
  918.         run105.addBreak();
  919.         // ------------------------------------------------------------
  920.         XWPFRun run11 = par.createRun();
  921.         run11.setFontSize(10);
  922.         run11.setBold(true);
  923.         run11.setFontFamily("Arial");
  924.         run11.setText("Tank repressurisation Method: ");
  925.         XWPFRun run12 = par.createRun();
  926.         run12.setFontSize(10);
  927.         run12.setFontFamily("Arial");
  928.         run12.setText(TRC);
  929.         run12.addBreak();
  930.         run12.addBreak();
  931.         // -----------------------------------------------------------
  932.         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  933.             docx.write(out);
  934.         }
  935.     }
  936.     public static void output_def(String ENN, String ECC, String OCC, String FCC, String AOOC, String NTC, String TRC,
  937.                                   String CMC, boolean isHyp, boolean isCryo, String purpose, String injector, String ARR,
  938.                                   String PCT, String PMR, String EET) throws IOException {
  939.         String lbrk = "======================================================================================================================";
  940.         File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
  941.         String message1 = "Propellant properties: ", message2, ThrottleRange, F_gimbalangle;
  942.         DecimalFormat f = new DecimalFormat("###,###,###");
  943.         //============================================================================================
  944.         if ((isCryo) && (isHyp)) {
  945.             message2 = "Hypergolic and cryogenic";
  946.         } else if ((isCryo) && (!isHyp)) {
  947.             message2 = "Not Hypergolic but cryogenic";
  948.         } else if ((!isCryo) && (isHyp)) {
  949.             message2 = "Hypergolic but not cryogenic";
  950.         } else {
  951.             message2 = "Neither Hypergolic nor cryogenic";
  952.         }
  953.         //============================================================================================
  954.         int uio96 = rN(1, 999);
  955.         int uio97 = rN(1, 11);
  956.         if (uio96 % uio97 == 0) {
  957.             int Throttle_MinV = rN(1, 99);
  958.             int Throttle_MaxV = rN(100, 15);
  959.             ThrottleRange = Throttle_MinV + "-" + Throttle_MaxV + "%";
  960.         } else {
  961.             ThrottleRange = "Not Throttleable";
  962.         }
  963.         //============================================================================================
  964.         if (purpose.contains("Vernier")) {
  965.             int gimbalangle = rN(0, 30);
  966.             if ((!(gimbalangle >= 1)) || AOOC.equals("80 km+ (Vacuum)")) {
  967.                 F_gimbalangle = "None";
  968.             } else {
  969.                 F_gimbalangle = gimbalangle+ "";
  970.             }
  971.         } else if (purpose.contains("Course Correction") && !purpose.contains("Lower Stage")) {
  972.             F_gimbalangle = "None";
  973.         } else {
  974.             int gimbalangle = rN(0, 10);
  975.             if ((!(gimbalangle >= 1)) || AOOC.equals("80 km+ (Vacuum)")) {
  976.                 F_gimbalangle = "None";
  977.             } else {
  978.                 F_gimbalangle = "±" + gimbalangle + "°";
  979.             }
  980.         }
  981.         //============================================================================================
  982.         int chambers = rN(1, 2);
  983.         String chamberN = "", cmbrM = "Engine chamber configuration: ";
  984.         if (chambers == 1 || NTC.contains("Aerospike")) {
  985.             chamberN = "Single Chamber";
  986.         } else if (chambers == 2) {
  987.             chamberN = "Dual Chamber";
  988.         } else if (chambers == 3) {
  989.             chamberN = "Quadruple Chamber";
  990.         }
  991.         //============================================================================================
  992.         System.out.println(lbrk + '\n' + "Engine Designation: " + ENN + '\n');
  993.         System.out.println("Fuel Flow Cycle: " + ECC);
  994.         System.out.println("Engine Oxidizer: " + OCC);
  995.         System.out.println("Engine Fuel: " + FCC);
  996.         System.out.println("Average Mixture Ratio: " + PMR);
  997.         System.out.println(message1 + message2);
  998.         System.out.println("Altitude Of Operation: " + AOOC);
  999.         System.out.println("Exhaust Nozzle Geometry: " + NTC);
  1000.         System.out.println("Exhaust Nozzle Area Ratio: " + ARR);
  1001.         System.out.println("Characteristic Exhaust Velocity: " + f.format(Integer.parseInt(EET)) + " m/s");
  1002.         System.out.println("Adiabatic Combustion Temperature: " + f.format(Integer.parseInt(PCT)) + "°K");
  1003.         System.out.println("Engine Gimbal Range: " + F_gimbalangle);
  1004.         System.out.println("Engine Injector Design: " + injector);
  1005.         System.out.println(cmbrM + chamberN);
  1006.         System.out.println("Engine Use Case: " + purpose);
  1007.         System.out.println("Tank repressurisation Method: " + TRC);
  1008.         System.out.println("Nozzle Cooling Mechanism: " + CMC);
  1009.         System.out.println("Engine Throttle Range: " + ThrottleRange + '\n');
  1010.         //============================================================================================
  1011.         XWPFDocument docx = new XWPFDocument();
  1012.         if (new File(String.valueOf(pathn1)).exists()) {
  1013.             docx = new XWPFDocument(new FileInputStream(String.valueOf(pathn1)));
  1014.         }
  1015.         XWPFParagraph par = docx.createParagraph();
  1016.         XWPFRun run = par.createRun();
  1017.         run.setFontSize(12);
  1018.         run.setBold(true);
  1019.         run.setFontFamily("Arial");
  1020.         run.setText("Engine Designation: ");
  1021.         run.setTextPosition(15);
  1022.         XWPFRun run2 = par.createRun();
  1023.         run2.setFontSize(12);
  1024.         run2.setBold(true);
  1025.         run2.setFontFamily("Arial");
  1026.         run2.setText(ENN);
  1027.         run2.setTextPosition(15);
  1028.         run2.addBreak();
  1029.         // -----------------------------------------------------------
  1030.         XWPFRun run3 = par.createRun();
  1031.         run3.setFontSize(10);
  1032.         run3.setBold(true);
  1033.         run3.setFontFamily("Arial");
  1034.         run3.setText("Fuel Flow Cycle: ");
  1035.         XWPFRun run4 = par.createRun();
  1036.         run4.setFontSize(10);
  1037.         run4.setFontFamily("Arial");
  1038.         run4.setText(ECC);
  1039.         run4.addBreak();
  1040.         // -----------------------------------------------------------
  1041.         XWPFRun run5 = par.createRun();
  1042.         run5.setFontSize(10);
  1043.         run5.setBold(true);
  1044.         run5.setFontFamily("Arial");
  1045.         run5.setText("Engine Oxidizer: ");
  1046.         XWPFRun run6 = par.createRun();
  1047.         run6.setFontSize(10);
  1048.         run6.setFontFamily("Arial");
  1049.         run6.setText(OCC);
  1050.         run6.addBreak();
  1051.         // -----------------------------------------------------------
  1052.         XWPFRun run8 = par.createRun();
  1053.         run8.setFontSize(10);
  1054.         run8.setBold(true);
  1055.         run8.setFontFamily("Arial");
  1056.         run8.setText("Engine Fuel: ");
  1057.         XWPFRun run7 = par.createRun();
  1058.         run7.setFontSize(10);
  1059.         run7.setFontFamily("Arial");
  1060.         run7.setText(FCC);
  1061.         run7.addBreak();
  1062.         // -----------------------------------------------------------
  1063.         XWPFRun run68 = par.createRun();
  1064.         run68.setFontSize(10);
  1065.         run68.setBold(true);
  1066.         run68.setFontFamily("Arial");
  1067.         run68.setText("Average Mixture Ratio: ");
  1068.         XWPFRun run67 = par.createRun();
  1069.         run67.setFontSize(10);
  1070.         run67.setFontFamily("Arial");
  1071.         run67.setText(PMR);
  1072.         run67.addBreak();
  1073.         // -----------------------------------------------------------
  1074.         XWPFRun run100 = par.createRun();
  1075.         run100.setFontSize(10);
  1076.         run100.setBold(true);
  1077.         run100.setFontFamily("Arial");
  1078.         run100.setText(message1);
  1079.         XWPFRun run107 = par.createRun();
  1080.         run107.setFontSize(10);
  1081.         run107.setBold(false);
  1082.         run107.setFontFamily("Arial");
  1083.         run107.setText(message2);
  1084.         run107.addBreak();
  1085.         // -----------------------------------------------------------
  1086.         XWPFRun run10 = par.createRun();
  1087.         run10.setFontSize(10);
  1088.         run10.setBold(true);
  1089.         run10.setFontFamily("Arial");
  1090.         run10.setText("Altitude Of Operation: ");
  1091.         XWPFRun run23 = par.createRun();
  1092.         run23.setFontSize(10);
  1093.         run23.setFontFamily("Arial");
  1094.         run23.setText(AOOC);
  1095.         run23.addBreak();
  1096.         // -----------------------------------------------------------
  1097.         XWPFRun run9 = par.createRun();
  1098.         run9.setFontSize(10);
  1099.         run9.setBold(true);
  1100.         run9.setFontFamily("Arial");
  1101.         run9.setText("Exhaust Nozzle Geometry: ");
  1102.         XWPFRun run0 = par.createRun();
  1103.         run0.setFontSize(10);
  1104.         run0.setFontFamily("Arial");
  1105.         run0.setText(NTC);
  1106.         run0.addBreak();
  1107.         // -----------------------------------------------------------
  1108.         XWPFRun run69 = par.createRun();
  1109.         run69.setFontSize(10);
  1110.         run69.setBold(true);
  1111.         run69.setFontFamily("Arial");
  1112.         run69.setText("Exhaust Nozzle Area Ratio: ");
  1113.         XWPFRun run60 = par.createRun();
  1114.         run60.setFontSize(10);
  1115.         run60.setFontFamily("Arial");
  1116.         run60.setText(ARR);
  1117.         run60.addBreak();
  1118.         // -----------------------------------------------------------
  1119.         XWPFRun run80 = par.createRun();
  1120.         run80.setFontSize(10);
  1121.         run80.setBold(true);
  1122.         run80.setFontFamily("Arial");
  1123.         run80.setText("Characteristic Exhaust Velocity: ");
  1124.         XWPFRun run79 = par.createRun();
  1125.         run79.setFontSize(10);
  1126.         run79.setFontFamily("Arial");
  1127.         run79.setText(f.format(Integer.parseInt(EET)) + " m/s");
  1128.         run79.addBreak();
  1129.         // -----------------------------------------------------------
  1130.         XWPFRun run89 = par.createRun();
  1131.         run89.setFontSize(10);
  1132.         run89.setBold(true);
  1133.         run89.setFontFamily("Arial");
  1134.         run89.setText("Adiabatic Combustion Temperature: ");
  1135.         XWPFRun run78 = par.createRun();
  1136.         run78.setFontSize(10);
  1137.         run78.setFontFamily("Arial");
  1138.         run78.setText(f.format(Integer.parseInt(PCT)) + "°K");
  1139.         run78.addBreak();
  1140.         // -----------------------------------------------------------
  1141.         XWPFRun run101 = par.createRun();
  1142.         run101.setFontSize(10);
  1143.         run101.setBold(true);
  1144.         run101.setFontFamily("Arial");
  1145.         run101.setText("Engine Gimbal Range: ");
  1146.         XWPFRun run27 = par.createRun();
  1147.         run27.setFontSize(10);
  1148.         run27.setFontFamily("Arial");
  1149.         run27.setText(F_gimbalangle);
  1150.         run27.addBreak();
  1151.         // -----------------------------------------------------------
  1152.         XWPFRun run102 = par.createRun();
  1153.         run102.setFontSize(10);
  1154.         run102.setBold(true);
  1155.         run102.setFontFamily("Arial");
  1156.         run102.setText("Engine Injector Design: ");
  1157.         XWPFRun run103 = par.createRun();
  1158.         run103.setFontSize(10);
  1159.         run103.setFontFamily("Arial");
  1160.         run103.setText(injector);
  1161.         run103.addBreak();
  1162.         // -----------------------------------------------------------
  1163.         XWPFRun run167 = par.createRun();
  1164.         run167.setFontSize(10);
  1165.         run167.setBold(true);
  1166.         run167.setFontFamily("Arial");
  1167.         run167.setText(cmbrM);
  1168.         XWPFRun run168 = par.createRun();
  1169.         run168.setFontSize(10);
  1170.         run168.setFontFamily("Arial");
  1171.         run168.setText(chamberN);
  1172.         run168.addBreak();
  1173.         // -----------------------------------------------------------
  1174.         XWPFRun run104 = par.createRun();
  1175.         run104.setFontSize(10);
  1176.         run104.setBold(true);
  1177.         run104.setFontFamily("Arial");
  1178.         run104.setText("Engine Use Case: ");
  1179.         XWPFRun run105 = par.createRun();
  1180.         run105.setFontSize(10);
  1181.         run105.setFontFamily("Arial");
  1182.         run105.setText(purpose);
  1183.         run105.addBreak();
  1184.         // -----------------------------------------------------------
  1185.         XWPFRun run11 = par.createRun();
  1186.         run11.setFontSize(10);
  1187.         run11.setBold(true);
  1188.         run11.setFontFamily("Arial");
  1189.         run11.setText("Tank repressurisation Method: ");
  1190.         XWPFRun run12 = par.createRun();
  1191.         run12.setFontSize(10);
  1192.         run12.setFontFamily("Arial");
  1193.         run12.setText(TRC);
  1194.         run12.addBreak();
  1195.         // -----------------------------------------------------------
  1196.         XWPFRun run13 = par.createRun();
  1197.         run13.setFontSize(10);
  1198.         run13.setBold(true);
  1199.         run13.setFontFamily("Arial");
  1200.         run13.setText("Nozzle Cooling Mechanism: ");
  1201.         XWPFRun run14 = par.createRun();
  1202.         run14.setFontSize(10);
  1203.         run14.setFontFamily("Arial");
  1204.         run14.setText(CMC);
  1205.         run14.addBreak();
  1206.         // -----------------------------------------------------------
  1207.         XWPFRun run15 = par.createRun();
  1208.         run15.setFontSize(10);
  1209.         run15.setBold(true);
  1210.         run15.setFontFamily("Arial");
  1211.         run15.setText("Engine Throttle Range: ");
  1212.         XWPFRun run16 = par.createRun();
  1213.         run16.setFontSize(10);
  1214.         run16.setFontFamily("Arial");
  1215.         run16.setText(ThrottleRange);
  1216.         run16.addBreak();
  1217.         run16.addBreak();
  1218.         // -----------------------------------------------------------
  1219.         try (FileOutputStream out = new FileOutputStream(String.valueOf(pathn1))) {
  1220.             docx.write(out);
  1221.         }
  1222.     }
  1223.     public static void main(String[] args) throws IOException {
  1224.         long start = System.currentTimeMillis();
  1225.         File org = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles");
  1226.         org.mkdir();
  1227.         File org1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/DevData");
  1228.         org1.mkdir();
  1229.         File org2 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData");
  1230.         org2.mkdir();
  1231.         // -------------------------------------
  1232.         File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/ofb_rex.docx");
  1233.         if (!(new File(String.valueOf(pathn1)).exists())) {
  1234.             XWPFDocument docx1 = new XWPFDocument();
  1235.             XWPFParagraph par1 = docx1.createParagraph();
  1236.             par1.setAlignment(ParagraphAlignment.CENTER);
  1237.             XWPFRun run1 = par1.createRun();
  1238.             run1.setText("Rocket Engine Registry");
  1239.             run1.setFontFamily("Arial");
  1240.             run1.setBold(true);
  1241.             run1.setFontSize(33);
  1242.             run1.setTextPosition(60);
  1243.             // -----------------------------------------------------------------------------
  1244.             XWPFParagraph par2 = docx1.createParagraph();
  1245.             par2.setAlignment(ParagraphAlignment.RIGHT);
  1246.             XWPFRun run2 = par2.createRun();
  1247.             LocalDateTime date = LocalDateTime.now();
  1248.             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMM yyyy, HH:mm:ss");
  1249.             String dt = date.format(formatter);
  1250.             run2.setText("Created on: " + dt);
  1251.             run2.setFontFamily("Arial");
  1252.             run2.setBold(true);
  1253.             run2.setFontSize(10);
  1254.             run2.setTextPosition(75);
  1255.             // ----------------------------------------------------------------------------------------------------
  1256.             try (FileOutputStream out1 = new FileOutputStream(String.valueOf(pathn1))) {
  1257.                 docx1.write(out1);
  1258.                 out1.close();
  1259.                 docx1.close();
  1260.             }
  1261.         }
  1262.         File ops = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData");
  1263.         ops.mkdir();
  1264.         System.out.println("""
  1265.                Welcome to the Advanced Rocket Engine Generator!
  1266.  
  1267.                """);
  1268.         Scanner scanner = new Scanner(System.in);
  1269.         String repeatCommand = "Y";
  1270.         int y = 0, h = 0;
  1271.         ArrayList<Double> yi = new ArrayList<>(100);
  1272.         while (!repeatCommand.equals("N")) {
  1273.             int FileLimit = 25;
  1274.             boolean test = true;
  1275.             if (test) {
  1276.                 if ((new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders/ofb_rex[Full]" + FileLimit + ".docx")).exists()) repeatCommand = "N";
  1277.             } else {
  1278.                 System.out.println("Do you want to generate a new rocket engine? Answer [Y/N] or [Yes/No]");
  1279.                 System.out.print(">>>>> ");
  1280.                 repeatCommand = scanner.next();
  1281.             }
  1282.             Path pathOne = Path.of(String.valueOf(pathn1));
  1283.             if (repeatCommand.equalsIgnoreCase("N") || repeatCommand.equalsIgnoreCase("NO")) {
  1284.                 float sum = 0;
  1285.                 for (int u = 0; u < (yi.size() - 1); u++) sum = (float) (sum + yi.get(u));
  1286.                 long end = System.currentTimeMillis();
  1287.                 float timen = (float)(end - start)/1000;
  1288.                 int engines = yi.size();
  1289.                 String FilesCreated = "Number of files created: " + FileLimit;
  1290.                 String bytesPerEngine;
  1291.                 if (engines <= 1) {
  1292.                     bytesPerEngine = '\n' + "Average amount of bytes per engine: " + (pathn1.length()/y) + " bytes";
  1293.                 } else {
  1294.                     bytesPerEngine = '\n' + "Average amount of bytes per engine: " + (sum / yi.size()) + " bytes";
  1295.                 }
  1296.                 String runTime;
  1297.                 if (timen < 60) {
  1298.                     runTime = "Total run time: " + timen + " secs";
  1299.                 } else if (timen/60 < 2) {
  1300.                     runTime = "Total run time: " + (int)Math.floor(timen/60) + " min " + Math.round(timen%60) + " secs";
  1301.                 } else {
  1302.                     runTime = "Total run time: " + (int)Math.floor(timen/60) + " mins " + Math.round(timen%60) + " secs";
  1303.                 }
  1304.                 try {
  1305.                     FileWriter fwrite = new FileWriter("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/DevData/dev.txt", true);
  1306.                     BufferedWriter fwriteFinal = new BufferedWriter(fwrite);
  1307.                     fwriteFinal.write('\n' + "===========================================================================");
  1308.                     fwriteFinal.write('\n');
  1309.                     fwriteFinal.write(FilesCreated);
  1310.                     fwriteFinal.write('\n');
  1311.                     fwriteFinal.write(bytesPerEngine);
  1312.                     fwriteFinal.write('\n');
  1313.                     fwriteFinal.write("Average amount of engines per file: " + sum + " engines");
  1314.                     fwriteFinal.write('\n');
  1315.                     fwriteFinal.write(runTime);
  1316.                     fwriteFinal.write('\n');
  1317.                     fwriteFinal.write("Rate of engine generation: " + h/timen + " engines/second");
  1318.                     fwriteFinal.write('\n');
  1319.                     fwriteFinal.write("Number of engines in files: " + h);
  1320.                     fwriteFinal.write('\n' + '\n');
  1321.                     fwriteFinal.close();
  1322.                 } catch (IOException e) {
  1323.                     e.printStackTrace();
  1324.                 }
  1325.                 System.exit(0);
  1326.             } else if (repeatCommand.equalsIgnoreCase("Y") || repeatCommand.equalsIgnoreCase("YES")) {
  1327.                 double sizeInbytes = pathn1.length();
  1328.                 double sizeInKilobytes = (sizeInbytes / 1024);
  1329.                 if (sizeInKilobytes >= 20) {
  1330.                     yi.add(sizeInbytes/y);
  1331.                     File logM = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles");
  1332.                     logM.mkdir();
  1333.                     // -------------------------------------------------------------------------------------------------
  1334.                     if ((new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders/ofb_rex[Full].docx")).exists()) {
  1335.                         int i;
  1336.                         y = 0;
  1337.                         int x = 2;
  1338.                         for (i = 1; i < x; i++) {
  1339.                             if ((new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders/ofb_rex[Full]" + i + ".docx")).exists()) {
  1340.                                 x++;
  1341.                             } else {
  1342.                                 Files.copy(pathOne, Paths.get("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders/ofb_rex[Full]" + i + ".docx"));
  1343.                             }
  1344.                         }
  1345.                     } else {
  1346.                         File org3 = new File("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders");
  1347.                         org3.mkdir();
  1348.                         Path logPF = Paths.get("C:/Users/Public/Operational_Functional_Block/Java_projects/src/GenFiles/GenData/FullFolders/ofb_rex[Full].docx");
  1349.                         Files.copy(pathOne, logPF);
  1350.                     }
  1351.                     XWPFDocument docx1 = new XWPFDocument();
  1352.                     XWPFParagraph par1 = docx1.createParagraph();
  1353.                     par1.setAlignment(ParagraphAlignment.CENTER);
  1354.                     XWPFRun run1 = par1.createRun();
  1355.                     run1.setText("Rocket Engine Generator");
  1356.                     run1.setFontFamily("Arial");
  1357.                     run1.setBold(true);
  1358.                     run1.setFontSize(33);
  1359.                     run1.setTextPosition(60);
  1360.                     // -----------------------------------------------------------------------------
  1361.                     XWPFParagraph par2 = docx1.createParagraph();
  1362.                     par2.setAlignment(ParagraphAlignment.RIGHT);
  1363.                     XWPFRun run2 = par2.createRun();
  1364.                     LocalDateTime date = LocalDateTime.now();
  1365.                     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMM yyyy, HH:mm:ss");
  1366.                     String dt = date.format(formatter);
  1367.                     run2.setText("Created on: " + dt);
  1368.                     run2.setFontFamily("Arial");
  1369.                     run2.setBold(true);
  1370.                     run2.setFontSize(10);
  1371.                     run2.setTextPosition(60);
  1372.                     // ----------------------------------------------------------------------------------------------------
  1373.                     FileOutputStream out1 = new FileOutputStream(String.valueOf(pathn1));
  1374.                     docx1.write(out1);
  1375.                     out1.close();
  1376.                     docx1.close();
  1377.                 }
  1378.                 String[] engine_Name1 = {"\"Argosy\"", "\"Galileo\"", "\"Callisto\"", "\"Nauka\"", "\"Insider\"", "\"Granis\"",
  1379.                         "\"Rassvet\"", "\"Zvezda\"", "\"Zarya\"", "\"Orion\"", "\"Ares\"", "\"Delta\"", "\"Atlas\"", "\"Dreadnought\"",
  1380.                         "\"Daedalus\"", "\"Baltia\"", "\"Dizhou\"", "\"Hermes\"", "\"Icarus\"", "\"Connestoga\"", "\"Yupiter\"",
  1381.                         "\"Emphasis\"", "\"Olympus\"", "\"Kronos\"", "\"Helios\"", "\"Alabaster\"", "\"Falcon\"", "\"Saturn\"",
  1382.                         "\"Eagle\"", "\"Endeavour\"", "\"Atlantis\"", "\"Cygnus\"", "\"Apollo\"", "\"Horizon\"", "\"Bulava\"",
  1383.                         "\"Pioneer\"", "\"Voyager\"", "\"Exploration\"", "\"Expedition\"", "\"Vulcan\"", "\"Vysota\"",
  1384.                         "\"Federation\"", "\"Sojourner\"", "\"Nautilus\"", "\"Jubilance\"", "\"Lagrange\"",  "\"Volna\"",
  1385.                         "\"Prometheus\"", "\"Tellus\"", "\"Alpha\"", "\"Delta\"", "\"Proton\"", "\"Neutron\"", "\"Topol\"",
  1386.                         "\"Electron\"", "\"Pluton\"", "\"Poodle\"", "\"Skipper\"", "\"Convair\"", "\"Nexus\"", "\"Oko\"",
  1387.                         "\"Vector\"", "\"Terrier\"", "\"Rhino\"", "\"Panther\"", "\"Goliath\"", "\"Juno\"", "\"Shrimp\"",
  1388.                         "\"Thumper\"", "\"Mainsail\"", "\"Dart\"", "\"Twitch\"", "\"Stratus\"", "\"Oscar\"", "\"Kosmos\"",
  1389.                         "\"Sentinel\"", "\"Pegasus\"", "\"Kelus\"", "\"Starshot\"", "\"Vernor\"", "\"Mammoth\"", "\"Liberty\"",
  1390.                         "\"Douglas\"", "\"Heimdall\"", "\"Dynetics\"", "\"Pathfinder\"", "\"Horizon\"", "\"Poisk\"",
  1391.                         "\"Pirs\"", "\"Philae\"", "\"Mariner\"", "\"Centaur\"", "\"Orel\"", "\"Pratt\"", "\"Hyperion\"",
  1392.                         "\"Sagittarius\"", "\"Apollo\"", "\"Bryton\"", "\"Volga\"", "\"Harmony\"", "\"Cassini\"", "\"Contour\"",
  1393.                         "\"Altair\"", "\"Dream\"", "\"Baikal\"", "\"Zenith\"", "\"Urpinod\"", "\"Bernal\"", "\"Condor\"",
  1394.                         "\"Athena\"", "\"Astra\"", "\"Aerolus\"", "\"Rombus\"", "\"Lunokhod\"", "\"Fregat\"", "\"Glonass\"",
  1395.                         "\"Dragon\"", "\"Salyut\"", "\"Starliner\"", "\"Skylab\"", "\"Briz\"", "\"Colombus\"", "\"Rosetta\"",
  1396.                         "\"Redstone\"", "\"Antares\"", "\"Philae\"", "\"Prospero\"", "\"Leonardo\"", "\"Parker\"", "\"Dyson\"",
  1397.                         "\"Oberon\"", "\"DragonFly\"", "\"Energia\"", "\"Buran\"", "\"Urgan\"", "\"Angara\"", "\"Vostok\"",
  1398.                         "\"Voskhod\"", "\"Shenzhou\"", "\"Ingenuity\"", "\"Oberon\"", "\"Discovery\"", "\"Horizon\"", "\"Visionalis\"",
  1399.                         "\"Cerasus\"", "\"Progress\"", "\"Unity\"", "\"Surveyor\"", "\"Prospector\"", "\"Ikar\"", "\"Redstone\"",
  1400.                         "\"Lapis\"", "\"Caesius\"", "\"Iridium\"", "\"Daedlus\"", "\"Aelita\"", "\"Beta\"", "\"Gamma\"",
  1401.                         "\"Alpha\"", "\"Epsilon\"", "\"Omega\"", "\"Discoverer\"", "\"Explorer\"", "\"Hornet\"", "\"Serenity\"",
  1402.                         "\"Ariane\"", "\"Hornet\"", "\"Asimov\"", "\"Pegasus\"", "\"Venture\"", "\"Antares\"", "\"Star\"",
  1403.                         "\"Archimedes\"", "\"Hera\"", "\"Iris\"", "\"Titan\"", "\"Artemis\"", "\"Phoenix\"", "\"Ross\"",
  1404.                         "\"Sarychev\"", "\"Nemesis\"", "\"Heimdall\"", "\"Sturt\"", "\"Odin\"", "\"Aethelred\"", "\"Vesper\"",
  1405.                         "\"Aces\"", "\"Argon\"", "\"Olympia\"", "\"Perseus\"", "\"Chyron\"", "\"Proxima\"", "\"Arminus\"",
  1406.                         "\"Destiny\"", "\"Valient\"", "\"FireFly\"", "\"Obsidian\"", "\"Leviathan\"", "\"Magellan\"", "\"Voyager\"",
  1407.                         "\"Mariner\"", "\"Joist\"", "\"Crimson\"", "\"Fortune\"", "\"Vanguard\"", "\"Aurora\"", "\"Ulysses\"",
  1408.                         "\"Crusader\"", "\"Python\"", "\"Kuiper\"", "\"Insurgent\"", "\"Pathfinder\"", "\"Kvant\"", "\"Spektr\"",
  1409.                         "\"Cassini\"", "\"Zemlya\"", "\"Dawn\"", "\"Kepler\"", "\"Parom\"", "\"Elektron\"", "\"Aeonian\"",
  1410.                         "\"Node\"", "\"Burya\"", "\"Voyager\"", "\"Ceres\"", "\"Bayern\"", "\"Chasovoy\"", "\"Copernicus\"",
  1411.                         "\"Quaoar\"", "\"Minotaur\"", "\"Agena\"", "\"Thor\"", "\"Vega\"", "\"Scout\"", "\"Coeus\"", "\"Minerva\"",
  1412.                         "\"Kratos\"", "\"Neith\"", "\"Omoikane\"", "\"Gayamun\"", "\"Odin\"", "\"Kronos\"", "\"Hope\"", "\"Polet\"",
  1413.                         "\"Polyot\"", "\"Sputnik\"", "\"Clementine\"", "\"Sojourner\"", "\"Ingenuity\"", "\"Perseverence\"",
  1414.                         "\"Onatchesko\"", "\"Atlantis\"", "\"Tsyklon\"", "\"Zenit\"", "\"Almaz\"", "\"Soyuz\"", "\"Molniya\"",
  1415.                         "\"Oreol\"", "\"Yantar\"", "\"Foton\"", "\"Meteor\"", "\"Ekran\"", "\"Strela\"", "\"Bion\"", "\"Piroda\"",
  1416.                         "\"Salyut\"", "\"Strela\"", "\"Luch\"", "\"Potok\"", "\"Prognoz\"", "\"Orlets\"", "\"Etalon\"", "\"Astron\"",
  1417.                         "\"Efir\"", "\"Kometa\"", "\"Fram\"", "\"Zemlya\"", "\"Gorizont\"", "\"Arkon\"", "\"Gamma\"", "\"Ekspress\"",
  1418.                         "\"Gonets\"", "\"Taifun\"", "\"Okean\"", "\"Reflektor\"", "\"Kolibr\"", "\"Sever\"", "\"Comet\"",
  1419.                         "\"Roton\"", "\"Solaris\"", "\"Altaris\"", "\"Ithacus\"", "\"Dekto\"", "\"Dream\"", "\"Impuls\"",
  1420.                         "\"Vremya\"", "\"Portal\"", "\"Zodiak\"", "\"Slava\"", "\"Inertsiya\"", "\"Stimuls\"", "\"Ambross\"",
  1421.                         "\"Amal\"", "\"Thea\"", "\"Orphelia\"", "\"Polyot\"", "\"Mudrost\"", "\"Carrack\"", "\"Artak\"",
  1422.                         "\"Questar\"", "\"Artyom\"", "\"Tsyclon\"", "\"Ascension\"", "\"Tenacity\"", "\"Contour\"", "\"Zephyr\"",
  1423.                         "\"Atlanta\"", "\"Polaris\"", "\"Aeolus\"", "\"Mayak\"", "\"Pamir\"", "\"Taimyr\"", "\"Cheget\"", "\"Sirius\"",
  1424.                         "\"Uragan\"", "\"Agat\"", "\"Skiph\"", "\"Kristall\"", "\"Altair\"", "\"Uran\"", "\"Ingul\"", "\"Carat\"",
  1425.                         "\"Pulsar\"", "\"Titan\"", "\"Eridanus\"", "\"Parus\"", "\"Cepheus\"", "\"Varagian\"", "\"Olympus\"",
  1426.                         "\"Tarkhaniy\"", "\"Astraeus\"", "\"Antares\"", "\"Kazbek\"", "\"Burlak\"", "\"Borei\"", "\"Favor\"",
  1427.                         "\"Rubin\"", "\"Almaz\"", "\"Granit\"", "\"Ruby\"", "\"Sokol\"", "\"Argon\"", "\"Kavkaz\"", "\"Ural\"",
  1428.                         "\"Berkut\"", "\"Dunay\"", "\"Yastreb\"", "\"Terek\"", "\"Radon\"", "\"Taymyr\"", "\"Pamir\"", "\"Photon\"",
  1429.                         "\"Elbrus\"", "\"Isayiev\"", "\"Shmel\"", "\"Kobra\"", "\"Shturn\"", "\"Metis\"", "\"Malyutka\"", "\"Fleyta\"",
  1430.                         "\"Konkurs\"", "\"Bastion\"", "\"Svir\"", "\"Ataka\"", "\"Vodopad\"", "\"Veter\"", "\"Vyuga\"", "\"Vulga\"",
  1431.                         "\"Tochka\"", "\"Oka\"", "\"Dvina\"", "\"Almaz\"", "\"Araks\"", "\"Kanopus\"", "\"Kliper\"", "\"Kobalt\"",
  1432.                         "\"Siluet\"", "\"Kondor\"", "\"Lotos\"", "\"Luch\"", "\"Mir\"", "\"Neman\"", "\"Obzor\"", "\"Okean\"",
  1433.                         "\"Oktan\"", "\"Orlets\"", "\"Poisk\"", "\"Potok\"", "\"Pirs\"", "\"Prognoz\"", "\"Resurs\"", "\"Rodnik\"",
  1434.                         "\"Romb\"", "\"Kapustin\"", "\"Oplot\"", "\"Tsygan\"", "\"Teplokhod\"", "\"Sokosha\"", "\"Rubezh\"",
  1435.                         "\"Zircon\"", "\"Moskva\"", "\"Tryol\"", "\"Ustinov\"", "\"Belyayev\"", "\"Novorod\"", "\"Argos\"",
  1436.                         "\"Nerthus\"", "\"Janus\"", "\"Hephaestus\"", "\"Themis\"", "\"Chronos\"", "\"Tethys\"", "\"Minos\"",
  1437.                         "\"Autumn\"", "\"Resilience\"", "\"Aelita\"", "\"Rheus\"", "\"Solntspek\"", "\"Spitzer\"", "\"Cartago\"",
  1438.                         "\"Melibea\"", "\"Spartacus\"", "\"Pulsar\"", "\"Fusion\"", "\"Reliant\"", "\"Thunder\"", "\"Novo\"",
  1439.                         "\"Panthera\"", "\"Nematoda\"", "\"Anelida\"", "\"Chordata\"", "\"Tetrapoda\"", "\"Cyclero\"", "\"Carrier\"",
  1440.                         "\"Gaia\"", "\"Irtysh\"", "\"Wyvern\"", "\"Tarsier\"", "\"Alpina\"", "\"Espadon\"", "\"Parlos\"", "\"Nebula\"",
  1441.                         "\"Lazarus\"", "\"Rufus\"", "\"Dornier\"", "\"Argus\"", "\"Kybau\"", "\"Kalau\"", "\"Chasvoy\"", "\"Zephyr\"",
  1442.                         "\"Temny\"", "\"Gorizont\"", "\"Yars\"", "\"Krugazor\"", "\"Soprotivlenye\"", "\"Shtil\"", "\"Layner\"",
  1443.                         "\"Arthropoda\"", "\"Hexapoda\"", "\"Crustacea\"", "\"Tardigrada\"", "\"Mollusca\"", "\"Annelida\"",
  1444.                         "\"Bryozoa\"", "\"Rotifera", "\"Brachiopoda\"", "\"Echinodermata\"", "\"Hemichordata\"", "\"Cnidaria\"",
  1445.                         "\"Staurozoa\"", "\"Hydrozoa\"", "\"Porifera", "\"Placozoa\"", "\"Craniata\"", "\"Tunicata\"", "\"Conodonta\"",
  1446.                         "\"Tetrapoda\"", "\"Amniota\"", "\"Synapsida\"", "\"Sauropsida", "\"Mammalia\"", "\"Sarcodina\"", "\"Aspin\"",
  1447.                         "\"Sporozoa\"", "\"Ciliata\"", "\"Filosa\"", "\"Toxoplasma\"", "\"Plasmodium\"", "\"Cryptomonada",
  1448.                         "\"Heterokonta\"", "\"Haptophyta\"", "\"Cercozoa\"", "\"Heliozoa\"", "\"Anapsida\"", "\"Aves\"", "\"Peewee\""};
  1449.                 String[] engine_Cycle = {"Gas Generator", "Staged Combustion (Oxidizer Rich)", "Staged Combustion (Fuel Rich)",
  1450.                         "Expander (Open/Bleed)", "Expander (Closed)", "Dual Expander (Open/Bleed)", "Dual Expander (Closed)",
  1451.                         "Pressure-Fed", "Full Flow Staged", "Electric Pump Fed", "Combustion Tap Off", "Monopropellant (Cold Gas)",
  1452.                         "Monopropellant (Decomposition)", "Gas Core", "Droplet Core", "Liquid Core", "Solid Core", "Vapor Core",
  1453.                         "Nuclear SaltWater", "Radioisotope Engine", "MagnetoPlasmaDynamic Thruster", "Hall Effect Thruster",
  1454.                         "Gridded Ion Thruster", "Colloid Thruster", "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)"};
  1455.                 String[] propellant_List1 = {"H2O2 (Hydrogen Peroxide)", "N2H4 (Hydrazine)", "NH2OH+NO3 (Hydroxylammonium nitrate)",
  1456.                         "65% NH4N(NO2)2 (Ammonium Dinitramide) + 35% CH3OH(Methanol)"};
  1457.                 String[] propellant_List2 = {"Nitrogen (N2)", "Helium (He)", "Carbon Dioxide (CO2)", "Ammonia (NH3)", "Hydrogen (H2)",
  1458.                         "Methane (CH4)"};
  1459.                 String[] altitude_Of_Operation = {"0-20 km (Sea Level)", "20-30 km (Medium Atmosphere)", "30-80 km (High Atmosphere)",
  1460.                         "80 km+ (Vacuum)", "Any Altitude (0-80 km+)"};
  1461.                 String[] tank_Repressurisation = {"Autogenous", "Inert Gas"};
  1462.                 String[] firstPart = {"RD", "RS", "AJ", "XLR", "NK", "RL", "KDTU", "AR", "BE", "MV", "YF", "PKA", "J", "RSA",
  1463.                         "MJ", "XS", "LM10", "HM", "LE", "LRE", "CE", "DST", "DOK", "KDU", "KRD", "RO", "LMS", "LMP", "RT",
  1464.                         "F", "E", "A", "B", "S.10", "engines", "JDK", "SPP", "TYS", "SOK", "RES", "FWR", "NAA75", "LR", "MA", "GE",
  1465.                         "OSA", "OBA", "NA", "RM02", "RM", "H", "MBB", "MB", "DF", "DE", "BF", "X", "BW", "BADR", "HS", "DC",
  1466.                         "UA", "FG", "P", "KMV", "M", "SRMU", "V", "KVD", "JD", "PS", "CE"};
  1467.                 String engine_Name = nameGen(engine_Name1, firstPart), engine_Cycle_Chosen = rand(engine_Cycle);
  1468.                 switch (engine_Cycle_Chosen) {
  1469.                     case "Gas Core", "Droplet Core", "Liquid Core", "Solid Core", "Vapor Core", "Nuclear SaltWater",
  1470.                             "Radioisotope Engine" -> {
  1471.                         String propellant_List_Chosen = "", nuclear_Cycle_Chosen = "", reactor_Fuel_Chosen = "",
  1472.                                 nozzle_Type_List_Chosen, remass_List_Chosen = "", propellantState = "", material;
  1473.                         double exhaustVel = 0;
  1474.                         int coreTemp = 0;
  1475.                         switch (engine_Cycle_Chosen) {
  1476.                             case "Radioisotope Engine" -> {
  1477.                                 String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  1478.                                         "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
  1479.                                 double [] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
  1480.                                 remass_List_Chosen = rand(remass_List);
  1481.                                 propellant_List_Chosen = remass_List_Chosen;
  1482.                                 nuclear_Cycle_Chosen = "";
  1483.                                 String[] reactor_fuel = {"Polonium-210", "Fermium-252", "Uranium-233", "Plutonium-238"};
  1484.                                 reactor_Fuel_Chosen = rand(reactor_fuel);
  1485.                                 propellantState = "Cryogenic Liquid";
  1486.                                 coreTemp = rN(2000, 200);
  1487.                                 int molmassi = findex(remass_List, remass_List_Chosen);
  1488.                                 double molmass = remass_EVD[molmassi];
  1489.                                 exhaustVel =(12400 / Math.pow(molmass, 0.531));
  1490.                             }
  1491.                             case "Solid Core" -> {
  1492.                                 String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  1493.                                         "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
  1494.                                 double [] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
  1495.                                 propellant_List_Chosen = remass_List_Chosen;
  1496.                                 String[] nuclear_cycle = {"LANTR", "LEUNTR", "LPNTR", "CERMET", "Pebble-Bed", ""};
  1497.                                 nuclear_Cycle_Chosen = rand(nuclear_cycle);
  1498.                                 String[] reactor_fuel = {"Uranium-235", "Plutonium-238"};
  1499.                                 propellantState = "Cryogenic Liquid";
  1500.                                 if (nuclear_Cycle_Chosen.equalsIgnoreCase("LANTR")) {
  1501.                                     // Combustion NTR (O2 + H2 = Higher Thrust)
  1502.                                     // 9,221 m/s with LH2 (Higher Isp, Lower Thrust)
  1503.                                     // 6,347 m/s with LOx-LH2 [3.5 Of ratio] (Lower Isp, Higher Thrust)
  1504.                                     // 3300 K
  1505.                                     // LOx injected after LH2 goes through nuclear core
  1506.                                     // Two gears: (LOx-LH2 and LH2)
  1507.                                     remass_List_Chosen = "Hydrogen (H2)";
  1508.                                     int enr_level = rN(8, 87);
  1509.                                     reactor_Fuel_Chosen = enr_level + "% " + rand(reactor_fuel);
  1510.                                     coreTemp = rN(1900 + (enr_level * 5), 1000);
  1511.                                     int molmassi = findex(remass_List, remass_List_Chosen);
  1512.                                     double molmass = remass_EVD[molmassi];
  1513.                                     exhaustVel = (17600 / Math.pow(molmass, 0.531));
  1514.                                 } else if (nuclear_Cycle_Chosen.equalsIgnoreCase("LEUNTR")) {
  1515.                                     // Low enrichment NTR (Higher Isp, 12.5% U-235)
  1516.                                     // 10,610 m/s with LH2
  1517.                                     // 3300 K
  1518.                                     // Uranium-235 within tungsten-rhenium cladding to allow molten Uranium
  1519.                                     remass_List_Chosen = rand(remass_List);
  1520.                                     int enr_level = rN(5, 10);
  1521.                                     reactor_Fuel_Chosen = enr_level + "% " + rand(reactor_fuel);
  1522.                                     coreTemp = rN(1900 + (enr_level * 5), 1000);
  1523.                                     int molmassi = findex(remass_List, remass_List_Chosen);
  1524.                                     double molmass = remass_EVD[molmassi];
  1525.                                     exhaustVel =(17600 / Math.pow(molmass, 0.531));
  1526.                                 } else if (nuclear_Cycle_Chosen.equalsIgnoreCase("LPNTR")){
  1527.                                     // Low Pressure NTR (Higher Isp)
  1528.                                     // 13,200 m/s with 1 dalton Exhaust
  1529.                                     // 12,100 m/s with 2 daltons Exhaust
  1530.                                     // 3600 K maximum
  1531.  
  1532.                                     // LightWeight and Reliable = Absence of certain heavy and fault-prone components
  1533.                                     // 1 Bar internal Pressure to allow mono-H to not pulverise the engine
  1534.                                     // Tank Pressure Fed = No Turbopump
  1535.                                     // Two gears = [H: for High Isp and H2: for lower Isp]
  1536.                                     // High temperature: is needed to make Single-H and crank up the specific impulse 1,350 seconds
  1537.                                     // Low pressure: counteracts the high temperature so the heat level is not high enough to melt the reactor
  1538.                                     // Maximizing propellant mass flow: counteracts the low pressure so the thrust-to-weight ratio is higher
  1539.                                     // LH2 injected into the center of the spherical core
  1540.                                     remass_List_Chosen = rand(remass_List);
  1541.                                     int enr_level = rN(8, 87);
  1542.                                     reactor_Fuel_Chosen = enr_level + "% " + rand(reactor_fuel);
  1543.                                     coreTemp = rN(1900 + (enr_level * 5), 1000);
  1544.                                     int molmassi = findex(remass_List, remass_List_Chosen);
  1545.                                     double molmass = remass_EVD[molmassi];
  1546.                                     exhaustVel =(17600 / Math.pow(molmass, 0.531));
  1547.                                 } else if (nuclear_Cycle_Chosen.equalsIgnoreCase("CERMET")){
  1548.                                     // Porous Tungsten impregnated with Uranium(IV) oxide
  1549.                                     // Thermal efficiency: 96%
  1550.                                     // Total efficiency: 70%
  1551.                                     // 9,810 m/s with LH2
  1552.                                     // 2800 K maximum
  1553.                                     remass_List_Chosen = rand(remass_List);
  1554.                                     int enr_level = rN(8, 87);
  1555.                                     reactor_Fuel_Chosen = enr_level + "% " + rand(reactor_fuel);
  1556.                                     coreTemp = rN(1900 + (enr_level * 5), 1000);
  1557.                                     int molmassi = findex(remass_List, remass_List_Chosen);
  1558.                                     double molmass = remass_EVD[molmassi];
  1559.                                     exhaustVel =(17600 / Math.pow(molmass, 0.531));
  1560.                                 } else if (nuclear_Cycle_Chosen.equalsIgnoreCase("Pebble-Bed")){
  1561.                                     // Particulate bed through which the working fluid is pumped
  1562.                                     // Rotated at 3000 RPM
  1563.                                     /* The radioactive particle core can be dumped at the end of an
  1564.                                        operational cycle to simplify maintenance and refurbishment. */
  1565.                                     // 9,530 m/s with LH2
  1566.                                     // 2800 K
  1567.                                     remass_List_Chosen = rand(remass_List);
  1568.                                     propellantState = "Cryogenic Liquid";
  1569.                                     propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen;
  1570.                                     nuclear_Cycle_Chosen = rand(nuclear_cycle);
  1571.                                     int enr_level = rN(8, 87);
  1572.                                     reactor_Fuel_Chosen = enr_level + "% " + "Uranium-235";
  1573.                                     coreTemp = rN(1400 + (enr_level * 5), 1000);
  1574.                                     int molmassi = findex(remass_List, remass_List_Chosen);
  1575.                                     double molmass = remass_EVD[molmassi];
  1576.                                     exhaustVel = ((9530*2) / Math.pow(molmass, 0.531));
  1577.                                 } else {
  1578.                                     // Normal Average NTR (GigaVirgin)
  1579.                                     remass_List_Chosen = rand(remass_List);
  1580.                                     int enr_level = rN(8, 87);
  1581.                                     reactor_Fuel_Chosen = enr_level + "% " + rand(reactor_fuel);
  1582.                                     coreTemp = rN(1900 + (enr_level * 5), 1000);
  1583.                                     int molmassi = findex(remass_List, remass_List_Chosen);
  1584.                                     double molmass = remass_EVD[molmassi];
  1585.                                     exhaustVel =(11000 / Math.pow(molmass, 0.531));
  1586.                                 }
  1587.                             }
  1588.                             case "Colloid Core" -> {
  1589.                                 // Between Gas core, Liquid Core and Solid Core
  1590.                                 // 11,800 m/s with H2
  1591.                                 // Uranium is a colloid in uranium carbide along with zirconium carbide
  1592.                                 // Uranium Fuel Loss: 28 kg/min
  1593.                                 // Engine Temp: 3,950°K
  1594.                                 // Engine Pressure: 200 atm
  1595.                                 String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  1596.                                         "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
  1597.                                 double [] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
  1598.                                 remass_List_Chosen = rand(remass_List);
  1599.                                 propellant_List_Chosen = "Uranium Zirconium Carbide(UC2 + ZrC) Colloid and " + remass_List_Chosen;
  1600.                                 nuclear_Cycle_Chosen = "";
  1601.                                 propellantState = "Cryogenic Liquid";
  1602.                                 int enr_level = rN(8, 87);
  1603.                                 reactor_Fuel_Chosen = enr_level + "% " + "Uranium-235";
  1604.                                 coreTemp = rN(2500 + (enr_level * 5), 1000);
  1605.                                 int molmassi = findex(remass_List, remass_List_Chosen);
  1606.                                 double molmass = remass_EVD[molmassi];
  1607.                                 exhaustVel = (11800 / Math.pow(molmass, 0.531));
  1608.                             }
  1609.                             case "Liquid Core" -> {
  1610.                                 // 19,620 m/s with H2
  1611.                                 // 5,000K maximum
  1612.                                 String[] remass_List, nuclear_cycle = {"\"Expander Bleed\"", "\"Expander Closed\"",
  1613.                                         "\"Vortex Confined\"", "LARS"};
  1614.                                 remass_List = new String[]{"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  1615.                                         "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
  1616.                                 double[] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
  1617.                                 String[] materials = {"Tungsten", "Osmium", "Rhenium", "Tantalum"};
  1618.                                 remass_List_Chosen = rand(remass_List);
  1619.                                 material = rand(materials);
  1620.                                 propellantState = "Cryogenic Liquid";
  1621.                                 propellant_List_Chosen = "Uranium impregnated " + material + " and " + remass_List_Chosen;
  1622.                                 nuclear_Cycle_Chosen = rand(nuclear_cycle);
  1623.                                 int enr_level = rN(8, 87);
  1624.                                 reactor_Fuel_Chosen = enr_level + "% " + "Uranium-235";
  1625.                                 coreTemp = rN(3500 + (enr_level * 5), 1000);
  1626.                                 int molmassi = findex(remass_List, remass_List_Chosen);
  1627.                                 double molmass = remass_EVD[molmassi];
  1628.                                 exhaustVel = (19620 / Math.pow(molmass, 0.531));
  1629.                             }
  1630.                             case "Droplet Core" -> {
  1631.                                 String[] remass_List, nuclear_cycle = {"\"Expander Bleed\"", "\"Expander Closed\"",
  1632.                                         "\"Vortex Confined\""};
  1633.                                 remass_List = new String[]{"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  1634.                                         "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
  1635.                                 double[] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
  1636.                                 remass_List_Chosen = rand(remass_List);
  1637.                                 propellantState = "Cryogenic Liquid";
  1638.                                 propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen;
  1639.                                 nuclear_Cycle_Chosen = rand(nuclear_cycle);
  1640.                                 int enr_level = rN(8, 87);
  1641.                                 reactor_Fuel_Chosen = enr_level + "% " + "Uranium-235";
  1642.                                 coreTemp = rN(5400 + (enr_level * 5), 1000);
  1643.                                 int molmassi = findex(remass_List, remass_List_Chosen);
  1644.                                 double molmass = remass_EVD[molmassi];
  1645.                                 exhaustVel = (19600 / Math.pow(molmass, 0.531));
  1646.                             }
  1647.                             case "Vapor Core" -> {
  1648.                                 String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  1649.                                         "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
  1650.                                 double[] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
  1651.                                 remass_List_Chosen = rand(remass_List);
  1652.                                 propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen;
  1653.                                 nuclear_Cycle_Chosen = "";
  1654.                                 reactor_Fuel_Chosen = "93% Uranium-235";
  1655.                                 propellantState = "Cryogenic Liquid";
  1656.                                 coreTemp = rN(5500, 1000);
  1657.                                 int molmassi = findex(remass_List, remass_List_Chosen);
  1658.                                 double molmass = remass_EVD[molmassi];
  1659.                                 exhaustVel = (11800 / Math.pow(molmass, 0.531));
  1660.                             }
  1661.                             case "Gas Core" -> {
  1662.                                 // Gaseous Nuclear vortex in a separate chamber of quartz suspended in Neon (Lightbulb)
  1663.                                 // 20,405 m/s with H2 (Closed)
  1664.                                 // 13,650 K
  1665.                                 String[] remass_List = {"Hydrogen (H2)", "Nitrogen (N2)", "Ammonia (NH3)", "Water (H2O)",
  1666.                                         "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)"};
  1667.                                 String[] nuclear_cycle = {"\"Nuclear Lightbulb\"", "\"Vortex Confined\"", "\"Wheel Flow\"",
  1668.                                         "\"Magnetohydrodynamic(MHD) vortex\""};
  1669.                                 double[] remass_EVD = {1.782, 14.6, 4.25, 6.587, 16, 14.6, 28};
  1670.                                 remass_List_Chosen = rand(remass_List);
  1671.                                 propellant_List_Chosen = "Uranium(VI) Fluoride (UF6) and " + remass_List_Chosen;
  1672.                                 nuclear_Cycle_Chosen = rand(nuclear_cycle);
  1673.                                 reactor_Fuel_Chosen = "93% Uranium-235";
  1674.                                 propellantState = "Cryogenic Liquid";
  1675.                                 coreTemp = rN(13650, 1000);
  1676.                                 int molmassi = findex(remass_List, remass_List_Chosen);
  1677.                                 double molmass = remass_EVD[molmassi];
  1678.                                 exhaustVel = (20405 / Math.pow(molmass, 0.531));
  1679.                             }
  1680.                             case "Nuclear SaltWater" -> {
  1681.                                 String[] fissile_salts = {"Uranium", "Plutonium"};
  1682.                                 String fissile_salt = rand(fissile_salts);
  1683.                                 if (!fissile_salt.equals("Plutonium")) {
  1684.                                     propellant_List_Chosen = fissile_salt + "(IV) TetraBromide (UBr4) + Water (H2O)";
  1685.                                 } else {
  1686.                                     propellant_List_Chosen = fissile_salt + "(III) TriBromide (PuBr3) + Water (H2O)";
  1687.                                 }
  1688.                                 remass_List_Chosen = "Water (H2O)";
  1689.                                 nuclear_Cycle_Chosen = "";
  1690.                                 propellantState = "Aqueous";
  1691.                                 int enri_level = rN(1, 2);
  1692.                                 if (enri_level == 1) {
  1693.                                     coreTemp = rN(25000, 1000);
  1694.                                     exhaustVel = rN(65500, 1000);
  1695.                                     reactor_Fuel_Chosen = 2 + "% " + fissile_salt;
  1696.                                 } else {
  1697.                                     coreTemp = rN(126800, 1000);
  1698.                                     exhaustVel = rN(4725000, 1000);
  1699.                                     reactor_Fuel_Chosen = 90 + "% " + fissile_salt;
  1700.                                 }
  1701.                             }
  1702.                         }
  1703.                         //============================================================================================
  1704.                         if (!engine_Cycle_Chosen.equals("Solid Core") || !engine_Cycle_Chosen.equals("Radioisotope Engine")) {
  1705.                             nozzle_Type_List_Chosen = rand(new String[]{"Contour Bell Nozzle", "Parabolic Bell Nozzle",
  1706.                                     "Magnetic Virtual Nozzle"});
  1707.                         } else {
  1708.                             nozzle_Type_List_Chosen = rand(new String[]{"Contour Bell Nozzle", "Parabolic Bell Nozzle"});
  1709.                         }
  1710.                         //============================================================================================
  1711.                         String[] cooling_mechanism = {"Radiative Cooling", "Dump Cooling", "Film Cooling", "Regenerative Cooling",
  1712.                                 "Transpiration Cooling"}, pot_uses = new String[] {"Upper Stage(Main Propulsion)",
  1713.                                 "Payload (Main Propulsion)", "Space Tug (Main Propulsion)"}, reactor_gen;
  1714.                         //============================================================================================
  1715.                         String use = rand(pot_uses), altitude_Of_Operation_Chosen = "80 km+ (Vacuum)",
  1716.                                 tank_Repressurisation_Chosen = rand(tank_Repressurisation),
  1717.                                 cooling_Mechanism_Chosen = rand(cooling_mechanism), reactor_gen_Chosen;
  1718.                         //============================================================================================
  1719.                         if ((engine_Cycle_Chosen.equals("Liquid Core") || engine_Cycle_Chosen.equals("Solid Core")
  1720.                                 || engine_Cycle_Chosen.equals("Pulsed Nuclear"))) {
  1721.                             reactor_gen = new String[]{"Generation III+", "Generation IV", "Generation V", "Generation V+"};
  1722.                         } else if (engine_Cycle_Chosen.equals("Nuclear SaltWater") || engine_Cycle_Chosen.equals("Radioisotope Engine")) {
  1723.                             reactor_gen = new String[]{"Engine has no reactor"};
  1724.                         } else {
  1725.                             reactor_gen = new String[]{"Generation II", "Generation III", "Generation III+",
  1726.                                     "Generation IV", "Generation V", "Generation V+"};
  1727.                         }
  1728.                         //============================================================================================
  1729.                         reactor_gen_Chosen = rand(reactor_gen);
  1730.                         int uio97 = rN(1, 456);
  1731.                         int uio98 = rN(1, 77);
  1732.                         boolean isBimodal = uio97%uio98 != 0;
  1733.                         String NzlReturnP = NzlParameters(altitude_Of_Operation_Chosen);
  1734.                         String[] parts = NzlReturnP.split(", ");
  1735.                         String AreaRatio = parts[1];
  1736.                         output_nt(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, nuclear_Cycle_Chosen,
  1737.                                 propellant_List_Chosen, reactor_Fuel_Chosen, nozzle_Type_List_Chosen, exhaustVel,
  1738.                                 tank_Repressurisation_Chosen, cooling_Mechanism_Chosen, use, reactor_gen_Chosen,
  1739.                                 isBimodal, remass_List_Chosen, propellantState, AreaRatio, coreTemp);
  1740.                         y++;
  1741.                         h++;
  1742.                     }
  1743.                     //============================================================================================
  1744.                     case "MagnetoPlasmaDynamic Thruster", "Hall Effect Thruster", "Gridded Ion Thruster",
  1745.                             "Colloid Thruster", "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)" -> {
  1746.                         String propellant_List_Chosen = null, nozzle_Type_List_Chosen = null;
  1747.                         switch (engine_Cycle_Chosen) {
  1748.                             case "Hall Effect Thruster" -> {
  1749.                                 String[] propellant_List = {"Xe (Xenon)", "Kr (Krypton)", "Ar (Argon)", "Bi (Bismuth)",
  1750.                                         "I2 (Iodine)", "Mg (Magnesium)", "Zn (Zinc)", "C10H16 (Adamantane)"};
  1751.                                 propellant_List_Chosen = rand(propellant_List);
  1752.                                 nozzle_Type_List_Chosen = "Hall Effect Thruster Nozzle";
  1753.                             } case "Gridded Ion Thruster" -> {
  1754.                                 String[] propellant_List = {"Xe (Xenon)", "Hg (Mercury)", "Cs (Caesium)"};
  1755.                                 propellant_List_Chosen = rand(propellant_List);
  1756.                                 nozzle_Type_List_Chosen = "Electrostatic Ion Nozzle";
  1757.                             } case "Colloid Thruster" -> {
  1758.                                 propellant_List_Chosen = "NH2OH+NO3 (Hydroxylammonium nitrate)";
  1759.                                 nozzle_Type_List_Chosen = "Capillary Emitter-Electrode Cone";
  1760.                             } case "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)" -> {
  1761.                                 String[] propellant_List = {"Xe (Xenon)", "Kr (Krypton)", "Ar (Argon)"};
  1762.                                 propellant_List_Chosen = rand(propellant_List);
  1763.                                 nozzle_Type_List_Chosen = "VASIMR Magnetic Confinement Nozzle";
  1764.                             } case "MagnetoPlasmaDynamic Thruster" -> {
  1765.                                 String[] propellant_List = {"Xe (Xenon)", "Ne (Neon)", "Ar (Argon)", "H2 (Hydrogen)", "N2H4 (Hydrazine)", "Li (Lithium)"};
  1766.                                 propellant_List_Chosen = rand(propellant_List);
  1767.                                 nozzle_Type_List_Chosen = "Cathode Plug Magnetic Confinement Nozzle";
  1768.                             }
  1769.                         }
  1770.                         String[] pot_uses = new String[]{"Payload (Main Propulsion)", "Space Tug (Main Propulsion)"};
  1771.                         String use = rand(pot_uses);
  1772.                         String[] powerGen_List = {"Hydrogen Fuel cell", "Nuclear Fission Reactor",
  1773.                                 "Nuclear Fusion Reactor", "Photovoltaic Panel", "Solar Thermal Panel",
  1774.                                 "Radioisotope Thermoelectric Generator (RTG)"};
  1775.                         String powerGen_List_Chosen = rand(powerGen_List);
  1776.                         String altitude_Of_Operation_Chosen = "80 km+ (Vacuum)";
  1777.                         output_et(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, propellant_List_Chosen,
  1778.                                 nozzle_Type_List_Chosen, powerGen_List_Chosen, use);
  1779.                         y++;
  1780.                         h++;
  1781.                     }
  1782.                     //============================================================================================
  1783.                     case "Monopropellant (Decomposition)" -> {
  1784.                         String[] nozzle_Type_List1 = {"Conical Nozzle", "Contour Bell Nozzle", "Parabolic Bell Nozzle"};
  1785.                         String[] cooling_mechanism = {"Ablative Cooling", "Radiative Cooling"};
  1786.                         String propellant_List_Chosen = rand(propellant_List1);
  1787.                         String altitude_Of_Operation_Chosen = "80 km+ (Vacuum)";
  1788.                         String nozzle_Type_List_Chosen = rand(nozzle_Type_List1);
  1789.                         String cooling_Mechanism_Chosen = rand(cooling_mechanism), catalyst_Chosen = null;
  1790.                         switch (propellant_List_Chosen) {
  1791.                             case "N2H4 (Hydrazine)", "65% NH4N(NO2)2 (Ammonium Dinitramide) + 35% CH3OH(Methanol)" -> {
  1792.                                 catalyst_Chosen = "Iridium coated Alumina Pellets";
  1793.                             } case "H2O2 (Hydrogen Peroxide)" -> {
  1794.                                 String[] catalyst = {"KMnO4 (Potassium Permanganate) Honeycomb", "Ag (Silver) Honeycomb",
  1795.                                 "MnO2 (Manganese Dioxide) Honeycomb", "K2Cr2O7 (Potassium dichromate) Honeycomb",
  1796.                                 "FeO (Iron (II) oxide)"};
  1797.                                 catalyst_Chosen = rand(catalyst);
  1798.                             } case "NH2OH+NO3 (Hydroxylammonium nitrate)" -> {
  1799.                                 catalyst_Chosen = "Iridium coated Copper Pellets";
  1800.                             }
  1801.                         }
  1802.                         String[] pot_uses = new String[]{"Upper Stage(Ullage)", "Upper Stage(Vernier)", "Payload (Main Propulsion)",
  1803.                                 "Payload (Vernier)", "Space Tug (Ullage)", "Space Tug (Vernier)"};
  1804.                         String use = rand(pot_uses);
  1805.                         output_monod(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, propellant_List_Chosen,
  1806.                                 nozzle_Type_List_Chosen, cooling_Mechanism_Chosen, catalyst_Chosen, use);
  1807.                         y++;
  1808.                         h++;
  1809.  
  1810.                     } case "Monopropellant (Cold Gas)" -> {
  1811.                         String[] nozzle_Type_List1 = {"Conical Nozzle", "Contour Bell Nozzle", "Parabolic Bell Nozzle"};
  1812.                         String propellant_List_Chosen = rand(propellant_List2);
  1813.                         String altitude_Of_Operation_Chosen = "80 km+ (Vacuum)";
  1814.                         String nozzle_Type_List_Chosen = rand(nozzle_Type_List1);
  1815.                         String cooling_Mechanism_Chosen = "Ablative Cooling";
  1816.                         String[] pot_uses = {"Upper Stage(Ullage)", "Upper Stage(Vernier)", "Payload (Main Propulsion)",
  1817.                                              "Payload (Vernier)", "Space Tug (Ullage)", "Space Tug (Vernier)"};
  1818.                         String purpose = rand(pot_uses);
  1819.                         output_mono(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen,
  1820.                                 propellant_List_Chosen, nozzle_Type_List_Chosen, cooling_Mechanism_Chosen, purpose);
  1821.                         y++;
  1822.                         h++;
  1823.                     }
  1824.                     //============================================================================================
  1825.                     case "Expander (Closed)", "Expander (Open/Bleed)" -> {
  1826.                         String[] oxidizer_List = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)"};
  1827.                         String oxidizer_Chosen = rand(oxidizer_List), fuel_Chosen = "";
  1828.                         switch (oxidizer_Chosen) {
  1829.                             case "O2 (Oxygen)" -> {
  1830.                                 String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1831.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  1832.                                         "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
  1833.                                 fuel_Chosen = rand(fuel_List);
  1834.                             } case "F2 (Fluorine)" -> {
  1835.                                 String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1836.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)",
  1837.                                         "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
  1838.                                 fuel_Chosen = rand(fuel_List);
  1839.                             } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> {
  1840.                                 String[] fuel_List = {"H2 (Hydrogen)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  1841.                                         "C12H26 (n-Dodecane)"};
  1842.                                 fuel_Chosen = rand(fuel_List);
  1843.                             }
  1844.                         }
  1845.                         StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
  1846.                                 tank_Repressurisation, altitude_Of_Operation);
  1847.                         y++;
  1848.                         h++;
  1849.                     }
  1850.                     //============================================================================================
  1851.                     case "Dual Expander (Closed)", "Dual Expander (Open/Bleed)" -> {
  1852.                         String[] oxidizer_List = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)"};
  1853.                         String oxidizer_Chosen = rand(oxidizer_List), fuel_Chosen = "";
  1854.                         String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)"};
  1855.                         switch (oxidizer_Chosen) {
  1856.                             case "O2 (Oxygen)", "F2 (Fluorine)" -> {
  1857.                                 fuel_Chosen = rand(fuel_List);
  1858.                             } case "F2 (Fluorine) + O2 (Oxygen)" -> fuel_Chosen = "H2 (Hydrogen)";
  1859.                         }
  1860.                         StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
  1861.                                 tank_Repressurisation, altitude_Of_Operation);
  1862.                         y++;
  1863.                         h++;
  1864.                     }
  1865.                     //============================================================================================
  1866.                     case "Staged Combustion (Fuel Rich)" -> {
  1867.                         String[] oxidizer_List = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)"};
  1868.                         String oxidizer_Chosen = rand(oxidizer_List), fuel_Chosen = "";
  1869.                         switch (oxidizer_Chosen) {
  1870.                             case "O2 (Oxygen)", "F2 (Fluorine)" -> {
  1871.                                 String[] fuel_List = {"H2 (Hydrogen)", "NH3 (Ammonia)", "N2H4 (Hydrazine)"};
  1872.                                 fuel_Chosen = rand(fuel_List);
  1873.                             } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> fuel_Chosen = "H2 (Hydrogen)";
  1874.                         }
  1875.                         StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
  1876.                                 tank_Repressurisation, altitude_Of_Operation);
  1877.                         y++;
  1878.                         h++;
  1879.                     }
  1880.                     //============================================================================================
  1881.                     case "Staged Combustion (Oxidizer Rich)" -> {
  1882.                         String[] oxidizer_List = {"O2 (Oxygen)", "O3 (Ozone)", "N2O4 (Nitrogen Tetroxide)"};
  1883.                         String oxidizer_Chosen = rand(oxidizer_List);
  1884.                         String fuel_Chosen = "";
  1885.                         switch (oxidizer_Chosen) {
  1886.                             case "O2 (Oxygen)", "O3 (Ozone)" -> {
  1887.                                 String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1888.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  1889.                                         "CH3OH (Methanol)"};
  1890.                                 fuel_Chosen = rand(fuel_List);
  1891.                             } case "N2O4 (Nitrogen Tetroxide)" -> {
  1892.                                 String[] fuel_List = {"C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  1893.                                         "C2H8N2 (UnsymmetricalDimethylHydrazine)"};
  1894.                                 fuel_Chosen = rand(fuel_List);
  1895.                             }
  1896.                         }
  1897.                         StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
  1898.                                 tank_Repressurisation, altitude_Of_Operation);
  1899.                         y++;
  1900.                         h++;
  1901.                     }
  1902.                     //============================================================================================
  1903.                     case "Full Flow Staged Combustion", "Combustion Tap Off" -> {
  1904.                         String[] oxidizer_List = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)",
  1905.                                 "O3 (Ozone)", "N2O4 (Nitrogen Tetroxide)"};
  1906.                         String oxidizer_Chosen = rand(oxidizer_List);
  1907.                         String fuel_Chosen = "";
  1908.                         switch (oxidizer_Chosen) {
  1909.                             case "O2 (Oxygen)" -> {
  1910.                                 String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1911.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  1912.                                         "CH3OH (Methanol)"};
  1913.                                 fuel_Chosen = rand(fuel_List);
  1914.                             } case "F2 (Fluorine)" -> {
  1915.                                 String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1916.                                         "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)",
  1917.                                         "N2H4 (Hydrazine)", "CH3OH (Methanol)"};
  1918.                                 fuel_Chosen = rand(fuel_List);
  1919.                             } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> {
  1920.                                 String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1921.                                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  1922.                                         "CH6N2 (MonomethylHydrazine)"};
  1923.                                 fuel_Chosen = rand(fuel_List);
  1924.                             } case "N2O4 (Nitrogen Tetroxide)" -> {
  1925.                                 String[] fuel_List = {"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1926.                                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  1927.                                         "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH3OH (Methanol)"};
  1928.                                 fuel_Chosen = rand(fuel_List);
  1929.                             }
  1930.                         }
  1931.                         StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
  1932.                                 tank_Repressurisation, altitude_Of_Operation);
  1933.                         y++;
  1934.                         h++;
  1935.                     }
  1936.                     //============================================================================================
  1937.                     default -> {
  1938.                         String[] oxidizer_List = {"O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)",
  1939.                                 "N2O4 (Nitrogen Tetroxide)", "H2O2 (Hydrogen Peroxide) 95%", "H2O2 (Hydrogen Peroxide) 85%",
  1940.                                 "O3 (Ozone)", "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)",
  1941.                                 "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)",
  1942.                                 "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)", "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)"};
  1943.                         String oxidizer_Chosen = rand(oxidizer_List);
  1944.                         String fuel_Chosen = "";
  1945.                         switch (oxidizer_Chosen) {
  1946.                             case "O2 (Oxygen)" -> {
  1947.                                 String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1948.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  1949.                                         "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
  1950.                                 fuel_Chosen = rand(fuel_List);
  1951.                             } case "F2 (Fluorine)" -> {
  1952.                                 String[] fuel_List = {"H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1953.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymmetricalDimethylHydrazine)",
  1954.                                         "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  1955.                                         "C12H26 (n-Dodecane)"};
  1956.                                 fuel_Chosen = rand(fuel_List);
  1957.                             } case "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)" -> {
  1958.                                 String[] fuel_List = {"H2 (Hydrogen)", "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
  1959.                                 fuel_Chosen = rand(fuel_List);
  1960.                             } case "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)",
  1961.                                     "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)",
  1962.                                     "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)" -> {
  1963.                                 String[] fuel_List = {"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  1964.                                         "CH3OH (Methanol)"};
  1965.                                 fuel_Chosen = rand(fuel_List);
  1966.                             } case "N2O4 (Nitrogen Tetroxide)", "H2O2 (Hydrogen Peroxide) 95%", "H2O2 (Hydrogen Peroxide) 85%"-> {
  1967.                                 String[] fuel_List = {"H2 (Hydrogen)", "C2H5OH(Ethanol) 95%", "C2H5OH(Ethanol) 75%",
  1968.                                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)", "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  1969.                                         "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  1970.                                         "CH3OH (Methanol)", "C12H26 (n-Dodecane)"};
  1971.                                 fuel_Chosen = rand(fuel_List);
  1972.                             }
  1973.                         }
  1974.                         StndrdDet(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen,
  1975.                                 tank_Repressurisation, altitude_Of_Operation);
  1976.                         y++;
  1977.                         h++;
  1978.                     }
  1979.                 }
  1980.             } else {
  1981.                 while (!(repeatCommand.equalsIgnoreCase("Y") && repeatCommand.equalsIgnoreCase("N") && repeatCommand.equalsIgnoreCase("YES") && repeatCommand.equalsIgnoreCase("NO"))) {
  1982.                     System.out.println("'" + repeatCommand + "'" + " is not a registered command,Please input an appropriate command [Y/N] or [Yes/No]");
  1983.                     System.out.print(">>>>> ");
  1984.                     repeatCommand = scanner.next();
  1985.                     if (repeatCommand.equalsIgnoreCase("Y") || repeatCommand.equalsIgnoreCase("N") || repeatCommand.equalsIgnoreCase("YES") || repeatCommand.equalsIgnoreCase("NO")) {
  1986.                         break;
  1987.                     }
  1988.                 }
  1989.             }
  1990.         }
  1991.     }
  1992. }
Advertisement
Add Comment
Please, Sign In to add comment