} // AccessPoint public bool InitializeSpace(int GlobalSpaceNumber, bool SimStart) { //int SpaceNum = space % (GV.numSpacesperAP); int LotSpaceNum = GV.FindLotNumberfromSpace(GlobalSpaceNumber); Vehicles[LotSpaceNum].SpaceNumber = GlobalSpaceNumber; return(Vehicles[LotSpaceNum].AcceptJob(SimStart)); }
} // GroupHub public bool InitializeSpace(int space, bool SimStart) { //int AP = space % (GV.numSpacesperAP * GV.numAPsperGroup); //AP = AP / (GV.numSpacesperAP); int AP = GV.FindAPNumberfromSpace(space); return(AccessPoints[AP].InitializeSpace(space, SimStart)); }
} // RegionHub public bool InitializeSpace(int space, bool SimStart) { //int Group = space % (GV.numSpacesperAP * GV.numAPsperGroup * GV.numGroupsperRegion); //Group = Group / (GV.numSpacesperAP * GV.numAPsperGroup); int Group = GV.FindGroupNumberfromSpace(space); return(Groups[Group].InitializeSpace(space, SimStart)); }
//public void StartCycle() //{ // numUploadstoDC = 0; // for (int i = 0; i < Groups.Length; i++) // { // Groups[i].StartCycle(); // } //} // StartCycle //public void EndCycle() //{ // for (int i = 0; i < Groups.Length; i++) // { // Groups[i].EndCycle(); // } //} // EndCycle public override void RequestTransmissionSlot(int destinationSpace) { numTransmissionRequests++; if (GV.FindRegionNumberfromSpace(destinationSpace) != NodeNum) { numUploadstoDC++; } } // AddTransmissionRequest
// Sends a message to the backup machine to notify it that it will be // receiving the VM corresponding to its job. public Boolean NotifyPartnerofTransfer(int SpaceNumber, double DataSize, GV.TransmissionType transType, Job job) { if (SpaceNumber == -1) { return(false); } else { int vehicle = GV.FindLotNumberfromSpace(SpaceNumber); return(Vehicles[vehicle].ReceiveNotificationofTransfer(DataSize, transType, job)); } }
// When a car finishes it's job, it will call this function to release the backup // vehicles public static void DeleteBackup(int Backup1, int Backup2) { int Region = 0; if (Backup1 != -1) { Region = GV.FindRegionNumberfromSpace(Backup1); Regions[Region].DeleteBackup(Backup1); } if (Backup2 != -1) { Region = GV.FindRegionNumberfromSpace(Backup2); Regions[Region].DeleteBackup(Backup2); } }
public int outputDataSize; // Size of the intermediate and output data in Mb // All jobs have a constant input size of 4000Mb. Defined in the GV class. /* * When a job is constructed, it generates itself and Initializes all the member variables. */ public Job() { jobNumber = GetNewJobNumber(); // Our slowest transfer speed is in Mbps, so when I generate a job, I calculate // the job length in seconds, and the output data size in Mb. Transmission time // of this metadata is negligible. jobLength = GV.GenerateRandomNumer(10800, 86400); outputDataSize = GV.GenerateRandomNumer(250, 1000) * 8; // Set the start time to the current simulation time. StartTime = GV.currentTime; investedRuntime = 0; } // Initialize
// Sends a message to the backup machine to notify it that it will be // receiving the VM corresponding to its job. public Boolean NotifyPartnerofTransfer(int SpaceNumber, double DataSize, GV.TransmissionType transType, Job job) { int AP = GV.FindAPNumberfromSpace(SpaceNumber); return(AccessPoints[AP].NotifyPartnerofTransfer(SpaceNumber, DataSize, transType, job)); }
// Sends a message to the backup machine to notify it that it will be // receiving the VM corresponding to its job. public Boolean NotifyPartnerofTransfer(int SpaceNumber, double DataSize, GV.TransmissionType transType, Job job) { int Group = GV.FindGroupNumberfromSpace(SpaceNumber); return(Groups[Group].NotifyPartnerofTransfer(SpaceNumber, DataSize, transType, job)); }
// Sends a message to the backup machine to notify it that it will be // receiving the VM corresponding to its job. public static Boolean NotifyPartnerofTransfer(int SpaceNumber, double DataSize, GV.TransmissionType transType, Job job) { int Region = GV.FindRegionNumberfromSpace(SpaceNumber); return(Regions[Region].NotifyPartnerofTransfer(SpaceNumber, DataSize, transType, job)); }
} // Receive // This function will assign an existing job to a new vehicle. // At this point in time it is used only for when a vehicle is backing // up a new job to other cars. public void AssignJobtoVehicle(Job job, int DestinationSpace, int WorkingVehicle, int dataSize) { int Group = GV.FindGroupNumberfromSpace(DestinationSpace); Groups[Group].AssignJobtoVehicle(job, DestinationSpace, WorkingVehicle, dataSize); }
// When a car finishes it's job, it will call this function to release the backup // vehicles public void DeleteBackup(int SpaceNumber) { int Group = GV.FindGroupNumberfromSpace(SpaceNumber); Groups[Group].DeleteBackup(SpaceNumber); }
// When a car finishes it's job, it will call this function to release the backup // vehicles public void DeleteBackup(int SpaceNumber) { int AP = GV.FindAPNumberfromSpace(SpaceNumber); AccessPoints[AP].DeleteBackup(SpaceNumber); }
} // Receive // This function will assign an existing job to a new vehicle. // At this point in time it is used only for when a vehicle is backing // up a new job to other cars. public void AssignJobtoVehicle(Job job, int DestinationSpace, int WorkingVehicle, int dataSize) { int AP = GV.FindAPNumberfromSpace(DestinationSpace); AccessPoints[AP].AssignJobtoVehicle(job, DestinationSpace, WorkingVehicle, dataSize); }
} // Receive // This function will assign an existing job to a new vehicle. // At this point in time it is used only for when a vehicle is backing // up a new job to other cars. public void AssignJobtoVehicle(Job job, int DestinationSpace, int WorkingVehicle, int dataSize) { int vehicle = GV.FindLotNumberfromSpace(DestinationSpace); Vehicles[vehicle].SetBackupAssignment(job, dataSize, WorkingVehicle); }
} // FindMigrationPartner // This function will assign an existing job to a new vehicle. // At this point in time it is used only for when a vehicle is backing // up a new job to other cars. public static void AssignJobtoVehicle(Job job, int DestinationSpace, int WorkingVehicle, int dataSize) { int Region = GV.FindRegionNumberfromSpace(DestinationSpace); Regions[Region].AssignJobtoVehicle(job, DestinationSpace, WorkingVehicle, dataSize); }
// When a car finishes it's job, it will call this function to release the backup // vehicles public void DeleteBackup(int SpaceNumber) { int vehicle = GV.FindLotNumberfromSpace(SpaceNumber); Vehicles[vehicle].DeleteBackup(); }