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); } }
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); } } }
internal static void ReadData(string fileName) { InputDataReader reader = new InputDataReader(fileName); _rollWidth = reader.ReadDouble(); _size = reader.ReadDoubleArray(); _amount = reader.ReadDoubleArray(); }
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; }
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); }
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; }
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; } }
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; }
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); }
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); } } }
/// <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(); }
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; } }
static void Main(string[] args) { var input = new InputDataReader(new FolderPathChecker()).Read(args); new Launcher().Synchronize(input); }
public void CreateInputValidArgs(params string[] args) { var input = new InputDataReader(new TestFolderPathChecker()).Read(args); }
public void CreateInputInvalidArgs(params string[] args) { Assert.Throws <SyncException>(() => { var input = new InputDataReader(new TestFolderPathChecker()).Read(args); }); }