public BinaryDecomposer(Array array, Array heftArray, Transformator transformator, int spaceDimension, int histogramResolution, int serverNO, int pointNO) { this.array = array; this.heftArray = heftArray; this.transformator = transformator; this.spaceDimension = spaceDimension; this.histogramResolution = histogramResolution; this.serverNO = serverNO; this.pointNO = pointNO; }
static void Main(string[] args) { Transformator transformator = new Transformator(); InputParser inputParser = new InputParser(transformator); HeftArrayCreator heftArrayCreator = new HeftArrayCreator(transformator); int serverNO; int pointNO; int spaceDimension; int histogramResolution; Array array; bool together = inputParser.determineTogetherOrSeparately(); if (together) { array = inputParser.parseInputFile(out spaceDimension, out histogramResolution, out serverNO, out pointNO); } else { parseInputSeparately(inputParser, out serverNO, out pointNO, out spaceDimension, out histogramResolution, out array); } double delta = (double)pointNO / (double)serverNO; Console.WriteLine("Point no.: {0}", pointNO); Console.WriteLine("Delta: {0}", delta); Array heftArray = heftArrayCreator.createHeftArray(spaceDimension, histogramResolution, array); LoadBalancingMeasure lbMeasure = new LoadBalancingMeasure(serverNO, pointNO, delta); BinaryDecomposer binaryDecomposer = new BinaryDecomposer(array, heftArray, transformator, spaceDimension, histogramResolution, serverNO, pointNO); Coords[] partition = binaryDecomposer.decompose(); double measureOfLB = lbMeasure.computeMeasure(partition); Console.WriteLine("Load balancing measure of the partition: {0}", measureOfLB); writeOutTiles(serverNO, spaceDimension, partition); writeOutServers(serverNO, partition); Console.WriteLine("Press any key to exit!"); Console.Read(); }
public InputParser(Transformator transformator) { this.transformator = transformator; }
public HeftArrayCreator(Transformator transformator) { this.transformator = transformator; }