public AuctionManagement(NetworkInterfaceCard communicationModule,
                          IMachinePowerController powerController,
                          UtilizationTable holder, TestedHosts testedHosts)
     : base(communicationModule, powerController, holder)
 {
     TestedHostsCount = testedHosts;
 }
 public AccountingModule(MachineTable machineTable, UtilizationTable utilizationTable,
                         RunConfiguration configuration)
 {
     ClearInformation();
     _machineTable          = machineTable;
     this._utilizationTable = utilizationTable;
     MeasureHolder          = new MeasureValueHolder(configuration);
 }
        public MasterMachine(NetworkSwitch networkSwitch, IMachinePowerController powerController,
                             UtilizationTable holder, Strategies strategy, AuctionTypes pushAuctionType, AuctionTypes pullAuctionType,
                             SchedulingAlgorithm scheduling,
                             TestedHosts testedHosts)
            : base(0, networkSwitch)
        {
            switch (strategy)
            {
            case Strategies.WAshraf2017Auction:
                _handler = new AuctionManagement(CommunicationModule, powerController, holder, testedHosts);
                break;

            case Strategies.WAshraf2017:
                _handler = new InorderPropingManagement(CommunicationModule, powerController, holder);
                break;

            case Strategies.Zhao:
                _handler = new NoMasterHandlerModule(CommunicationModule);
                break;

            case Strategies.ForsmanPush:
                _handler = new NoMasterHandlerModule(CommunicationModule);
                break;

            case Strategies.ForsmanPull:
                _handler = new NoMasterHandlerModule(CommunicationModule);
                break;

            case Strategies.Proposed2018:

                _handler = new ProposedMasterHandler(CommunicationModule, powerController, holder, testedHosts, pushAuctionType, pullAuctionType);
                break;

            default:

                throw new ArgumentOutOfRangeException(nameof(strategy), strategy, null);
            }

            Holder = holder;
            //StartMachine();
            switch (scheduling)
            {
            case SchedulingAlgorithm.FF:
                scheduler = new FirstFitScheduler(holder, CommunicationModule, powerController);
                break;

            case SchedulingAlgorithm.MFull:
            case SchedulingAlgorithm.LFull:
                scheduler = new AuctionScheduler(holder, CommunicationModule, powerController, scheduling);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(scheduling), scheduling, null);
            }
        }
Esempio n. 4
0
 public ProposedMasterHandler(NetworkInterfaceCard communicationModule,
                              IMachinePowerController powerController,
                              UtilizationTable dataHolder,
                              TestedHosts testedHosts, AuctionTypes pushAuctionType, AuctionTypes pullAuctionType) : base(communicationModule)
 {
     PowerController  = powerController;
     DataHolder       = dataHolder;
     TestedHostsCount = testedHosts;
     PushAuctionType  = pushAuctionType;
     PullAuctionType  = pullAuctionType;
 }
Esempio n. 5
0
 public MasterFactory(NetworkSwitch networkSwitchObject,
                      MachineController machineControllerObject,
                      UtilizationTable utilizationTable,
                      Strategies currentStrategy,
                      AuctionTypes pushAuctionType,
                      AuctionTypes pullAuctionType,
                      SchedulingAlgorithm schedulingAlgorithm,
                      TestedHosts testedHostsCount) : base(networkSwitchObject)
 {
     this.networkSwitchObject     = networkSwitchObject;
     this.machineControllerObject = machineControllerObject;
     this.utilizationTable        = utilizationTable;
     this.currentStrategy         = currentStrategy;
     PushAuctionType          = pushAuctionType;
     PullAuctionType          = pullAuctionType;
     this.schedulingAlgorithm = schedulingAlgorithm;
     this.testedHostsCount    = testedHostsCount;
 }
Esempio n. 6
0
        public SimulationController(RunConfiguration configuration)
        {
            CurrentConfiguration   = configuration;
            MachineTableObject     = new MachineTable();
            UtilizationTable       = new UtilizationTable();
            AccountingModuleObject = new AccountingModule(MachineTableObject, UtilizationTable,
                                                          CurrentConfiguration);
            _networkSwitchObject = new NetworkSwitch(MachineTableObject, AccountingModuleObject, configuration.NetworkDealy);

            MachineControllerObject
                = new MachineController(UtilizationTable, MachineTableObject, CurrentConfiguration.ContainersType);
            _masterFactory
                = new MasterFactory(_networkSwitchObject, MachineControllerObject, UtilizationTable,
                                    CurrentConfiguration.Strategy, CurrentConfiguration.PushAuctionType, CurrentConfiguration.PullAuctionType, CurrentConfiguration.SchedulingAlgorithm, CurrentConfiguration.TestedHosts);
            var h = new Load(Global.DataCenterHostConfiguration);

            _hostFactory = new HostFactory(h,
                                           _networkSwitchObject, CurrentConfiguration.LoadPrediction, CurrentConfiguration.Strategy, CurrentConfiguration.ContainersType, configuration.SimulationSize);
            _registryFactory  = new RegistryFactory(_networkSwitchObject, configuration.SimulationSize);
            _containerFactory = new ContainerFactory(CurrentConfiguration.ContainersType, configuration.SimulationSize, configuration.LoadPrediction);
        }
        public MachineController(UtilizationTable holder, MachineTable machineTable, ContainersType containerTypes)
        {
            MachineTable            = machineTable;
            ReadyMachineTable       = new MachineTable();
            PoweredOffMachinesTable = new MachineTable();

            ContainerTypes = containerTypes;
            DataHolder     = holder;
            Task t = new Task(async() =>
            {
                while (Started)
                {
                    var currentTotal = MachineTable.GetHostsCount();
                    var mcount       = Convert.ToInt32(currentTotal * 0.05);
                    var rcount       = ReadyMachineTable.GetHostsCount();
                    if (!StartingMachine)
                    {
                        if (mcount > rcount && PoweredOffMachinesTable.GetHostsCount() > 0)
                        {
                            await WakeIdleHost();
                        }
                        else if (mcount < rcount)
                        {
                            await PowerOffExtraMachines();
                        }
                    }
                    //else
                    //{

                    //}
                    await Task.Delay(Global.Second);
                }
            });

            t.Start();
        }
 public MineCommon(NetworkInterfaceCard communicationModule, IMachinePowerController powerController, UtilizationTable dataHolder) : base(communicationModule)
 {
     PowerController = powerController;
     DataHolder      = dataHolder;
 }
 public AuctionScheduler(UtilizationTable holder, NetworkInterfaceCard communicationModule, IMachinePowerController powerContoller, SchedulingAlgorithm schedulingAlgorithm) : base(holder, communicationModule, powerContoller)
 {
     this.schedulingAlgorithm = schedulingAlgorithm;
 }
Esempio n. 10
0
 public FirstFitScheduler(UtilizationTable holder,
                          NetworkInterfaceCard communicationModule,
                          IMachinePowerController powerContoller) : base(holder, communicationModule, powerContoller)
 {
 }
 public InorderPropingManagement(NetworkInterfaceCard nic,
                                 IMachinePowerController powerController,
                                 UtilizationTable holder)
     : base(nic, powerController, holder)
 {
 }
Esempio n. 12
0
 public BaseScheduler(UtilizationTable holder, NetworkInterfaceCard communicationModule, IMachinePowerController powerContoller)
 {
     Holder = holder;
     this.CommunicationModule = communicationModule;
     this.powerContoller      = powerContoller;
 }