コード例 #1
0
        }         // 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));
        }
コード例 #2
0
        }         // 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));
        }
コード例 #3
0
        }         // 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));
        }
コード例 #4
0
        //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
コード例 #5
0
 // 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));
     }
 }
コード例 #6
0
        // 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);
            }
        }
コード例 #7
0
		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
コード例 #8
0
        // 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));
        }
コード例 #9
0
        // 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));
        }
コード例 #10
0
        // 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));
        }
コード例 #11
0
        }          // 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);
        }
コード例 #12
0
        // 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);
        }
コード例 #13
0
        // 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);
        }
コード例 #14
0
        }          // 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);
        }
コード例 #15
0
        }          // 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);
        }
コード例 #16
0
        }         // 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);
        }
コード例 #17
0
        // 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();
        }