Class Site


  • public class Site
    extends java.lang.Object
    A data class that models a site as a collection of processors. The number of processors can only be specified in the constructor.
    Version:
    $Revision$
    Author:
    Karan Vahi
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int mCurrentProcessorIndex
      The index to the processor that is to be used for scheduling a job.
      private java.lang.String mName
      The logical name assigned to the site.
      private int mNumProcessors
      The number of processors making up a site.
      private java.util.List mProcessors
      A list of processors making up the site.
    • Constructor Summary

      Constructors 
      Constructor Description
      Site​(java.lang.String name)
      The default constructor.
      Site​(java.lang.String name, int num)
      The overloaded constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getAvailableProcessors()
      Returns the number of available processors.
      long getAvailableTime​(long start)
      Returns the earliest time the site is available for scheduling a job.
      java.lang.String getName()
      Returns the name of the site.
      void scheduleJob​(long start, long end)
      Schedules a job to the site.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mNumProcessors

        private int mNumProcessors
        The number of processors making up a site.
      • mProcessors

        private java.util.List mProcessors
        A list of processors making up the site.
      • mCurrentProcessorIndex

        private int mCurrentProcessorIndex
        The index to the processor that is to be used for scheduling a job.
      • mName

        private java.lang.String mName
        The logical name assigned to the site.
    • Constructor Detail

      • Site

        public Site​(java.lang.String name)
        The default constructor.
        Parameters:
        name - the name to be assigned to the site.
      • Site

        public Site​(java.lang.String name,
                    int num)
        The overloaded constructor.
        Parameters:
        name - the name to be assigned to the site.
        num - the number of processors.
    • Method Detail

      • getAvailableTime

        public long getAvailableTime​(long start)
        Returns the earliest time the site is available for scheduling a job. It is non insertion based scheduling policy.
        Parameters:
        start - the time at which to start the search.
        Returns:
        long
      • scheduleJob

        public void scheduleJob​(long start,
                                long end)
        Schedules a job to the site.
        Parameters:
        start - the start time of the job.
        end - the end time for the job
      • getName

        public java.lang.String getName()
        Returns the name of the site.
        Returns:
        name of the site.
      • getAvailableProcessors

        public int getAvailableProcessors()
        Returns the number of available processors.
        Returns:
        number of available processors.