
                        // Monte Carlo Results
                        String directoryPath = "MonteCarloSimulationresults";
                        File directory = new File(directoryPath);
                        // Count the number of files starting with "MCSResults_" and ending with ".txt"
                        String[] files = directory.list((dir, name) -> name.startsWith("MCSResults_") && name.endsWith(".txt"));
                        int count = (files != null) ? files.length : 0;
                        count++;

                        String fileName = "MCSResults_" + count+ ".txt";
                        String filePath = Paths.get(directoryPath, fileName).toString();
                        boolean isTransitive = (transitive.equalsIgnoreCase("y")) ? true : false;
                        String roundedDuration = String.format("%.3f", durationInSeconds);

                        String content = numRanks+"&"+numDefImplications+"&"+distribution+"&"+minStatements+"&"+reuseConsequent+"&"+isTransitive+"&"+anComplexity.get(0)+"&"+consComplexity.get(0)+"&"+connectors+"&"+roundedDuration+"\\\\ \n";
                        
                        try (FileWriter fileWriter = new FileWriter(filePath, true);
                        PrintWriter printWriter = new PrintWriter(fileWriter)) {
                            // Write the content to the file
                            printWriter.println(content);
                        } catch (IOException e) {
                            e.printStackTrace();
                        }