Пример #1
0
  private void generateConnectedNodesWithinRadiusH() throws Exception {
    MFilePlotData NodeDistributionData =
        new MFilePlotData(
            "",
            "Node Degree Distribution",
            "Node Degree Distribution",
            "DistNodesWithinR.m",
            outputDirectory,
            null,
            20);

    Vector<Vector<TreeMap<Integer, Integer>>> data =
        new Vector<Vector<TreeMap<Integer, Integer>>>();

    for (int i = 0; i < networks.size(); i++) {
      Vector<TreeMap<Integer, Integer>> curNetworkData = new Vector<TreeMap<Integer, Integer>>();

      Vector<CalculatedGraph> networkSeries = networks.get(i);

      for (int j = 0; j < networkSeries.size(); j++) {
        TreeMap<Integer, Integer> dist = networkSeries.get(j).getConnectedNodesWithinRadius(.16);
        curNetworkData.add(dist);
      }

      data.add(curNetworkData);
    }

    DistWriter NodeDistributionPlotter = new DistWriter(NodeDistributionData);
    NodeDistributionPlotter.PlotDistInt(data);
  }
Пример #2
0
  private void generateNodeDistributionH() throws Exception {
    MFilePlotData NodeDistributionData =
        new MFilePlotData(
            "",
            "Node Degree Distribution",
            "Node Degree Distribution",
            "NodeDistribution.m",
            outputDirectory,
            null,
            20);

    Vector<Vector<TreeMap<Integer, Integer>>> data =
        new Vector<Vector<TreeMap<Integer, Integer>>>();

    for (int i = 0; i < networks.size(); i++) {
      Vector<TreeMap<Integer, Integer>> curNetworkData = new Vector<TreeMap<Integer, Integer>>();

      Vector<CalculatedGraph> networkSeries = networks.get(i);

      System.out.println("How many graphs - " + networkSeries.size());

      for (int j = 0; j < networkSeries.size(); j++) {
        TreeMap<Integer, Integer> dist = networkSeries.get(j).getNodeDistribution();

        curNetworkData.add(dist);
      }

      data.add(curNetworkData);
    }

    DistWriter NodeDistributionPlotter = new DistWriter(NodeDistributionData);
    NodeDistributionPlotter.PlotDistInt(data);
  }
Пример #3
0
  private void generateLinksLongerThan_rPlot() throws Exception {
    MFilePlotData getLinksLongerThanRData =
        new MFilePlotData(
            "",
            "Links longer than R=" + GraphConstants.MeasurementR,
            "Links longer than R=" + GraphConstants.MeasurementR,
            "LinksLongerThanR.m",
            outputDirectory,
            null,
            20);

    Vector<TreeMap<Double, Integer>> optimizedData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < optimized.size(); i++) {
      TreeMap<Double, Integer> dist = optimized.get(i).getLinksLongerThan_r();
      optimizedData.add(dist);
    }

    Vector<TreeMap<Double, Integer>> exponentialData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < exponential.size(); i++) {
      TreeMap<Double, Integer> dist = exponential.get(i).getLinksLongerThan_r();
      exponentialData.add(dist);
    }

    Vector<TreeMap<Double, Integer>> heuristicData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < heuristic.size(); i++) {
      TreeMap<Double, Integer> dist = heuristic.get(i).getLinksLongerThan_r();
      heuristicData.add(dist);
    }

    DistWriter LinksLongerThanRPlotter = new DistWriter(getLinksLongerThanRData);
    LinksLongerThanRPlotter.PlotDist(optimizedData, exponentialData, heuristicData);
  }
Пример #4
0
  private void generateConnectedNodesWithinRadius() throws Exception {
    MFilePlotData ConnectedNodesWithinRadiusData =
        new MFilePlotData(
            "",
            "Connected Nodes Within R=" + GraphConstants.MeasurementR,
            "Connected Nodes Within Radius" + GraphConstants.MeasurementR,
            "ConnectedNodesWithinRadius_questionable.m",
            outputDirectory,
            null,
            20);

    Vector<TreeMap<Integer, Integer>> optimizedData = new Vector<TreeMap<Integer, Integer>>();
    for (int i = 0; i < optimized.size(); i++) {
      TreeMap<Integer, Integer> dist = optimized.get(i).getConnectedNodesWithinRadius();
      optimizedData.add(dist);
    }

    Vector<TreeMap<Integer, Integer>> exponentialData = new Vector<TreeMap<Integer, Integer>>();
    for (int i = 0; i < exponential.size(); i++) {
      TreeMap<Integer, Integer> dist = exponential.get(i).getConnectedNodesWithinRadius();
      exponentialData.add(dist);
    }

    Vector<TreeMap<Integer, Integer>> heuristicData = new Vector<TreeMap<Integer, Integer>>();
    for (int i = 0; i < heuristic.size(); i++) {
      TreeMap<Integer, Integer> dist = heuristic.get(i).getConnectedNodesWithinRadius();
      heuristicData.add(dist);
    }

    DistWriter ConnectedNodesWithinRadiusPlotter = new DistWriter(ConnectedNodesWithinRadiusData);
    ConnectedNodesWithinRadiusPlotter.PlotDistInt(optimizedData, exponentialData, heuristicData);
  }
Пример #5
0
  private void generateBetweeness() throws Exception {
    MFilePlotData BetweenessData =
        new MFilePlotData(
            "", "Betweeness", "Betweeness", "Betweeness.m", outputDirectory, null, 20);

    Vector<TreeMap<Double, Integer>> optimizedData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < optimized.size(); i++) {
      TreeMap<Double, Integer> dist = optimized.get(i).getBetweeness();
      optimizedData.add(dist);
    }

    Vector<TreeMap<Double, Integer>> exponentialData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < exponential.size(); i++) {
      System.out.println("exp iter" + i);
      TreeMap<Double, Integer> dist = exponential.get(i).getBetweeness();
      exponentialData.add(dist);
    }

    Vector<TreeMap<Double, Integer>> heuristicData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < heuristic.size(); i++) {
      TreeMap<Double, Integer> dist = heuristic.get(i).getBetweeness();
      heuristicData.add(dist);
    }

    DistWriter BetweenessPlotter = new DistWriter(BetweenessData);
    BetweenessPlotter.PlotDist(optimizedData, exponentialData, heuristicData);
  }
Пример #6
0
  private void generateISPL() throws Exception {
    MFilePlotData ISPLData =
        new MFilePlotData("", "ISPL", "ISPL", "ISPL.m", outputDirectory, null, 20);

    Vector<TreeMap<Double, Integer>> optimizedData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < optimized.size(); i++) {
      TreeMap<Double, Integer> dist = optimized.get(i).getDistributionISPL();
      optimizedData.add(dist);
    }

    Vector<TreeMap<Double, Integer>> exponentialData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < exponential.size(); i++) {
      TreeMap<Double, Integer> dist = exponential.get(i).getDistributionISPL();
      exponentialData.add(dist);
    }

    Vector<TreeMap<Double, Integer>> heuristicData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < heuristic.size(); i++) {
      TreeMap<Double, Integer> dist = heuristic.get(i).getDistributionISPL();
      heuristicData.add(dist);
    }

    DistWriter ISPLPlotter = new DistWriter(ISPLData);
    ISPLPlotter.PlotDist(optimizedData, exponentialData, heuristicData);
  }
Пример #7
0
  private void generateNodeDistribution() throws Exception {
    MFilePlotData NodeDistributionData =
        new MFilePlotData(
            "",
            "Node Degree Distribution",
            "Node Degree Distribution",
            "NodeDistribution.m",
            outputDirectory,
            null,
            20);

    Vector<TreeMap<Integer, Integer>> optimizedData = new Vector<TreeMap<Integer, Integer>>();
    for (int i = 0; i < optimized.size(); i++) {
      TreeMap<Integer, Integer> dist = optimized.get(i).getNodeDistribution();
      optimizedData.add(dist);
    }

    Vector<TreeMap<Integer, Integer>> exponentialData = new Vector<TreeMap<Integer, Integer>>();
    for (int i = 0; i < exponential.size(); i++) {
      TreeMap<Integer, Integer> dist = exponential.get(i).getNodeDistribution();
      exponentialData.add(dist);
    }

    Vector<TreeMap<Integer, Integer>> heuristicData = new Vector<TreeMap<Integer, Integer>>();
    for (int i = 0; i < heuristic.size(); i++) {
      TreeMap<Integer, Integer> dist = heuristic.get(i).getNodeDistribution();
      heuristicData.add(dist);
    }

    DistWriter NodeDistributionPlotter = new DistWriter(NodeDistributionData);
    NodeDistributionPlotter.PlotDistInt(optimizedData, exponentialData, heuristicData);
  }
Пример #8
0
  private void generateNodeMaxiumumEdgeLength() throws Exception {
    MFilePlotData NodeMaximumEdgeData =
        new MFilePlotData(
            "",
            "Node Maximum Edge Length",
            "Node Maximum Edge Length",
            "NodeMaximumEdgeLength.m",
            outputDirectory,
            null,
            20);

    Vector<TreeMap<Double, Integer>> optimizedData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < optimized.size(); i++) {
      TreeMap<Double, Integer> dist = optimized.get(i).getNodeMaximumEdgeLength();
      optimizedData.add(dist);
    }

    Vector<TreeMap<Double, Integer>> exponentialData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < exponential.size(); i++) {
      TreeMap<Double, Integer> dist = exponential.get(i).getNodeMaximumEdgeLength();
      exponentialData.add(dist);
    }

    Vector<TreeMap<Double, Integer>> heuristicData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < heuristic.size(); i++) {
      TreeMap<Double, Integer> dist = heuristic.get(i).getNodeMaximumEdgeLength();
      heuristicData.add(dist);
    }

    DistWriter NodeMaximumEdgeLengthPlotter = new DistWriter(NodeMaximumEdgeData);
    NodeMaximumEdgeLengthPlotter.PlotDist(optimizedData, exponentialData, heuristicData);
  }
Пример #9
0
  private void generateMeanDegreeOfConnectedNeighbors() throws Exception {
    MFilePlotData NodeTotalEdgeCostData =
        new MFilePlotData(
            "",
            "Mean Degree Of Connected Neighbors",
            "Mean Degree Of Connected Neighbors",
            "MeanDegreeOfConnectedNeighbors.m",
            outputDirectory,
            null,
            20);

    Vector<TreeMap<Double, Integer>> optimizedData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < optimized.size(); i++) {
      TreeMap<Double, Integer> dist = optimized.get(i).getMeanDegreeOfConnectedNeighbors();
      optimizedData.add(dist);
    }

    Vector<TreeMap<Double, Integer>> exponentialData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < exponential.size(); i++) {
      TreeMap<Double, Integer> dist = exponential.get(i).getMeanDegreeOfConnectedNeighbors();
      exponentialData.add(dist);
    }

    Vector<TreeMap<Double, Integer>> heuristicData = new Vector<TreeMap<Double, Integer>>();
    for (int i = 0; i < heuristic.size(); i++) {
      TreeMap<Double, Integer> dist = heuristic.get(i).getMeanDegreeOfConnectedNeighbors();
      heuristicData.add(dist);
    }

    DistWriter NodeTotalEdgeLengthPlotter = new DistWriter(NodeTotalEdgeCostData);
    NodeTotalEdgeLengthPlotter.PlotDist(optimizedData, exponentialData, heuristicData);
  }
Пример #10
0
  private void generateLinkLengthsH() throws Exception {

    MFilePlotData NodeDistributionData =
        new MFilePlotData(
            "",
            "Node Degree Distribution",
            "Node Degree Distribution",
            "DistLinkLengths.m",
            outputDirectory,
            null,
            20);

    Vector<Vector<TreeMap<Double, Integer>>> data = new Vector<Vector<TreeMap<Double, Integer>>>();

    for (int i = 0;
        i < 1;
        // networks.size();
        i++) {
      Vector<TreeMap<Double, Integer>> curNetworkData = new Vector<TreeMap<Double, Integer>>();

      Vector<CalculatedGraph> networkSeries = networks.get(i);

      for (int j = 0; j < networkSeries.size(); j++) {
        TreeMap<Double, Integer> dist = networkSeries.get(j).getDistributionLinkLengths();
        curNetworkData.add(dist);
      }

      data.add(curNetworkData);
    }

    for (int i = 3; i < 4; i++) {
      Vector<TreeMap<Double, Integer>> curNetworkData = new Vector<TreeMap<Double, Integer>>();

      Vector<CalculatedGraph> networkSeries = networks.get(i);

      for (int j = 0; j < networkSeries.size(); j++) {
        TreeMap<Double, Integer> dist = networkSeries.get(j).getDistributionLinkLengths();
        curNetworkData.add(dist);
      }

      data.add(curNetworkData);
    }

    DistWriter NodeDistributionPlotter = new DistWriter(NodeDistributionData);
    NodeDistributionPlotter.PlotDist(data);
  }
Пример #11
0
  private void generateFitness() throws Exception {
    MFilePlotData mFilePlotData =
        new MFilePlotData(
            "Fitness", "", "Distribution of Fitness", "FitnessDist.m", outputDirectory, null, 20);

    Vector<Double> optimizedData = new Vector<Double>();
    for (int i = 0; i < optimized.size(); i++) {
      optimizedData.add(optimized.get(i).getFitnessValue());
    }

    Vector<Double> exponentialData = new Vector<Double>();
    for (int i = 0; i < exponential.size(); i++) {
      exponentialData.add(exponential.get(i).getFitnessValue());
    }

    Vector<Double> heuristicData = new Vector<Double>();
    for (int i = 0; i < heuristic.size(); i++) {
      heuristicData.add(heuristic.get(i).getFitnessValue());
    }

    DistWriter writer = new DistWriter(mFilePlotData);
    writer.plotDoubleVectors(optimizedData, exponentialData, heuristicData);
  }