Class OSTNURandomGenerator

java.lang.Object
it.univr.di.cstnu.util.OSTNURandomGenerator

public class OSTNURandomGenerator extends Object
Allows one to build random OSTNU instances specifying:
  • number of wanted DC/NOT DC instances
And the following parameters that characterize each generated instance:
  • number nodes
  • number of contingent nodes
  • number of oracles
  • max weight for each edge
  • max weight for each contingent link (upper value)
  • max in-degree for each node
  • max out-degree for each node
  • probability to have an edge between any pair of nodes

The class generates the wanted instances, building each one randomly and, then, DC checking it for stating its DC property.

Version:
1.0
Author:
posenato
  • Field Details

  • Constructor Details

    • OSTNURandomGenerator

      public OSTNURandomGenerator(int givenDcInstances, int givenNotDCInstances, int nodes, int nCtgNodes1, double edgeProbability, int givenMaxWeight, int givenMaxContingentWeight)
      Parameters:
      givenDcInstances - the wanted dc instances
      givenNotDCInstances - the wanted not-dc instances
      nodes - the number of nodes
      nCtgNodes1 - the number of contingent nodes
      edgeProbability - the probability of an edge between two nodes
      givenMaxWeight - the maximum edge weight
      givenMaxContingentWeight - max contingent duration
      Throws:
      IllegalArgumentException - if one or more parameters has/have not valid value/s.
      IllegalArgumentException - if any.
  • Method Details

    • main

      public static void main(String[] args) throws FileNotFoundException, IOException
      Parameters:
      args - input args
      Throws:
      FileNotFoundException - if any.
      IOException - if any.
    • getDcInstanceNumber

      public int getDcInstanceNumber()

      getDcInstanceNumber.

      Returns:
      the dcInstances
    • getEdgeProb

      public double getEdgeProb()

      Getter for the field edgeProb.

      Returns:
      the edgeProb
    • getMaxWeight

      public int getMaxWeight()

      Getter for the field maxWeight.

      Returns:
      the maxWeight
    • getNodeNumber

      public int getNodeNumber()

      getNodeNumber.

      Returns:
      the nNodes
    • getNotDCInstanceNumber

      public int getNotDCInstanceNumber()

      getNotDCInstanceNumber.

      Returns:
      the notDCInstances
    • getNotDCSubDir

      public File getNotDCSubDir()

      Getter for the field notDCSubDir.

      Returns:
      the notDCSubDir
    • getObsQLoopNumber

      public int getObsQLoopNumber()

      getObsQLoopNumber.

      Returns:
      the nObsQLoop
    • getVersionAndCopyright

      public String getVersionAndCopyright()
      Returns:
      version and copyright string