Example #1
0
 internal Data(string filename) {
    InputDataReader reader = new InputDataReader(filename);
    
    foodCost = reader.ReadDoubleArray();
    foodMin  = reader.ReadDoubleArray();
    foodMax  = reader.ReadDoubleArray();
    nutrMin  = reader.ReadDoubleArray();
    nutrMax  = reader.ReadDoubleArray();
    nutrPerFood = reader.ReadDoubleArrayArray();
  
    nFoods = foodMax.Length;
    nNutrs = nutrMax.Length;
  
    if ( nFoods != foodMin.Length  ||
         nFoods != foodMax.Length    )
       throw new ILOG.Concert.Exception("inconsistent data in file " 
                                        + filename);
    if ( nNutrs != nutrMin.Length    ||
         nNutrs != nutrPerFood.Length  )
       throw new ILOG.Concert.Exception("inconsistent data in file " 
                                        + filename);
    for (int i = 0; i < nNutrs; ++i) {
       if ( nutrPerFood[i].Length != nFoods )
          throw new ILOG.Concert.Exception("inconsistent data in file " 
                                        + filename);
    }
 }
Example #2
0
        internal Data(string filename)
        {
            InputDataReader reader = new InputDataReader(filename);

            foodCost    = reader.ReadDoubleArray();
            foodMin     = reader.ReadDoubleArray();
            foodMax     = reader.ReadDoubleArray();
            nutrMin     = reader.ReadDoubleArray();
            nutrMax     = reader.ReadDoubleArray();
            nutrPerFood = reader.ReadDoubleArrayArray();

            nFoods = foodMax.Length;
            nNutrs = nutrMax.Length;

            if (nFoods != foodMin.Length ||
                nFoods != foodMax.Length)
            {
                throw new ILOG.Concert.Exception("inconsistent data in file " + filename);
            }
            if (nNutrs != nutrMin.Length ||
                nNutrs != nutrPerFood.Length)
            {
                throw new ILOG.Concert.Exception("inconsistent data in file " + filename);
            }
            for (int i = 0; i < nNutrs; ++i)
            {
                if (nutrPerFood[i].Length != nFoods)
                {
                    throw new ILOG.Concert.Exception("inconsistent data in file " + filename);
                }
            }
        }
Example #3
0
 internal static void ReadData(string fileName) {
    InputDataReader reader = new InputDataReader(fileName);
    
    _rollWidth = reader.ReadDouble();
    _size      = reader.ReadDoubleArray();
    _amount    = reader.ReadDoubleArray();
 }
Example #4
0
    internal static void ReadData(string fileName)
    {
        InputDataReader reader = new InputDataReader(fileName);

        _rollWidth = reader.ReadDouble();
        _size      = reader.ReadDoubleArray();
        _amount    = reader.ReadDoubleArray();
    }
Example #5
0
    internal static void ReadData(string fileName)
    {
        InputDataReader reader = new InputDataReader(fileName);

        _minArray = reader.ReadDoubleArray();
        _maxArray = reader.ReadDoubleArray();
        _cost     = reader.ReadDoubleArray();
        _demand   = reader.ReadDouble();

        _generators = _minArray.Length;
    }
Example #6
0
            internal Data(string filename)
            {
                InputDataReader reader = new InputDataReader(filename);

                time     = reader.ReadDoubleArrayArray();
                distance = reader.ReadDoubleArrayArray();
                n        = time.Length;

                timeNormalized     = CrossCutting.CrossCutting.UnitVectorScaleDoubleArrayArray(time, n, n);
                distanceNormalized = CrossCutting.CrossCutting.UnitVectorScaleDoubleArrayArray(distance, n, n);
            }
Example #7
0
      internal Data(string filename) {
         InputDataReader reader = new InputDataReader(filename);

         activityOnResource = reader.ReadIntArrayArray();
         duration           = reader.ReadDoubleArrayArray();
         dueDate            = reader.ReadDoubleArray();
         earlinessCost      = reader.ReadDoubleArray();
         tardinessCost      = reader.ReadDoubleArray();

         nJobs      = dueDate.Length;
         nResources = activityOnResource.Length;
      }
Example #8
0
        internal Data(string filename)
        {
            InputDataReader reader = new InputDataReader(filename);

            activityOnResource = reader.ReadIntArrayArray();
            duration           = reader.ReadDoubleArrayArray();
            dueDate            = reader.ReadDoubleArray();
            earlinessCost      = reader.ReadDoubleArray();
            tardinessCost      = reader.ReadDoubleArray();

            nJobs      = dueDate.Length;
            nResources = activityOnResource.Length;
        }
Example #9
0
        internal Data(string fileName)
        {
            InputDataReader reader = new InputDataReader(fileName);

            arcCost  = reader.ReadDoubleArrayArray();
            numNodes = arcCost.Length;
            for (int i = 0; i < numNodes; ++i)
            {
                if (arcCost[i].Length != numNodes)
                {
                    throw new ILOG.Concert.Exception("inconsistent data in file " + fileName);
                }
                arcCost[i][i] = 0.0;
            }
        }
Example #10
0
    internal static void ReadData(string fileName)
    {
        InputDataReader reader = new InputDataReader(fileName);

        _avail    = reader.ReadDoubleArray();
        _rate     = reader.ReadDoubleArray();
        _inv0     = reader.ReadDoubleArray();
        _prodCost = reader.ReadDoubleArray();
        _invCost  = reader.ReadDoubleArray();
        _revenue  = reader.ReadDoubleArrayArray();
        _market   = reader.ReadDoubleArrayArray();

        _nProd = _rate.Length;
        _nTime = _avail.Length;
    }
Example #11
0
 internal static void ReadData(string fileName) {
    System.Console.WriteLine("Reading data from " + fileName);
    InputDataReader reader = new InputDataReader(fileName);
  
    _capacity  = reader.ReadDoubleArray();
    _fixedCost = reader.ReadDoubleArray();
    _cost      = reader.ReadDoubleArrayArray();
  
    _nbLocations = _capacity.Length;
    _nbClients   = _cost.Length;
  
    for(int i = 0; i < _nbClients; i++)
       if ( _cost[i].Length != _nbLocations )
         throw new ILOG.Concert.Exception("inconsistent data in file " + fileName);
 }
Example #12
0
    internal static void ReadData(string fileName)
    {
        System.Console.WriteLine("Reading data from " + fileName);
        InputDataReader reader = new InputDataReader(fileName);

        _capacity  = reader.ReadDoubleArray();
        _fixedCost = reader.ReadDoubleArray();
        _cost      = reader.ReadDoubleArrayArray();

        _nbLocations = _capacity.Length;
        _nbClients   = _cost.Length;

        for (int i = 0; i < _nbClients; i++)
        {
            if (_cost[i].Length != _nbLocations)
            {
                throw new ILOG.Concert.Exception("inconsistent data in file " + fileName);
            }
        }
    }
Example #13
0
        /// <summary>
        /// Load named entities from input XML
        /// </summary>
        private static void LoadNamedEntitiesFromXML()
        {
            //string filePath = GetDataPath(@"input_skwiki-latest-pages-articles.xml")
            string filePath = GetDataPath();
            var    reader   = new InputDataReader();

            reader.SetPagesFromInputFile(filePath);
            var pages = reader.Pages;

            //init arrays
            Infoboxes = new List <Infobox>();
            Geoboxes  = new List <Geobox>();
            Citations = new List <Citation>();

            //init arrays for output
            Persons       = new List <string>();
            Organizations = new List <string>();
            Locations     = new List <string>();

            CategorizeProperties(pages);

            //get entities
            Persons       = Persons.Select(x => WordUtils.TrimNonLetterCharacters(x, true)).OrderBy(x => x).Distinct(StringComparer.CurrentCultureIgnoreCase).ToList();
            Organizations = Organizations.Select(x => WordUtils.TrimNonLetterCharacters(x)).OrderBy(x => x).Distinct(StringComparer.CurrentCultureIgnoreCase).ToList();
            Locations     = Locations.Select(x => WordUtils.TrimNonLetterCharacters(x, false)).OrderBy(x => x).Distinct(StringComparer.CurrentCultureIgnoreCase).ToList();

            //write data into output files
            NamedEntityWriter.WriteData(Persons, PersonsFileName);
            NamedEntityWriter.WriteData(Organizations, OrganizationsFileName);
            NamedEntityWriter.WriteData(Locations, LocationsFileName);

            //start finder
            var finder = new Finder(Persons, Organizations, Locations);

            finder.Find();
        }
Example #14
0
 internal Data(string fileName)
 {
     InputDataReader reader = new InputDataReader(fileName);
      arcCost = reader.ReadDoubleArrayArray();
      numNodes = arcCost.Length;
      for (int i = 0; i < numNodes; ++i)
      {
     if ( arcCost[i].Length != numNodes )
        throw new ILOG.Concert.Exception("inconsistent data in file " + fileName);
     arcCost[i][i] = 0.0;
      }
 }
Example #15
0
    internal static void ReadData(string fileName)
    {
        InputDataReader reader = new InputDataReader(fileName);

          _minArray = reader.ReadDoubleArray();
          _maxArray = reader.ReadDoubleArray();
          _cost     = reader.ReadDoubleArray();
          _demand   = reader.ReadDouble();

          _generators = _minArray.Length;
    }
Example #16
0
        static void Main(string[] args)
        {
            var input = new InputDataReader(new FolderPathChecker()).Read(args);

            new Launcher().Synchronize(input);
        }
Example #17
0
    internal static void ReadData(string fileName)
    {
        InputDataReader reader = new InputDataReader(fileName);

          _avail    = reader.ReadDoubleArray();
          _rate     = reader.ReadDoubleArray();
          _inv0     = reader.ReadDoubleArray();
          _prodCost = reader.ReadDoubleArray();
          _invCost  = reader.ReadDoubleArray();
          _revenue  = reader.ReadDoubleArrayArray();
          _market   = reader.ReadDoubleArrayArray();

          _nProd = _rate.Length;
          _nTime = _avail.Length;
    }
Example #18
0
 public void CreateInputValidArgs(params string[] args)
 {
     var input = new InputDataReader(new TestFolderPathChecker()).Read(args);
 }
Example #19
0
 public void CreateInputInvalidArgs(params string[] args)
 {
     Assert.Throws <SyncException>(() => { var input = new InputDataReader(new TestFolderPathChecker()).Read(args); });
 }