org.iids.aos.locationmanager.negotiationmodule.domainpolicies
Class runtimeDomainPolicy

java.lang.Object
  extended by org.iids.aos.locationmanager.negotiationmodule.domainpolicies.DomainPolicy
      extended by org.iids.aos.locationmanager.negotiationmodule.domainpolicies.runtimeDomainPolicy

public class runtimeDomainPolicy
extends DomainPolicy

Domain wide policy for handling requests for the AgentScape runtime resource. Current tempalte policy is: return all. Current host offer selection policy is: round robin, for non-overlapping groups of hosts.


Constructor Summary
runtimeDomainPolicy()
           
 
Method Summary
 java.util.Vector<AgreementOffer> applyHostOfferSelectionPolicy(AgreementOffer ao, java.util.Vector<AgreementOffer> leaseOffers)
          Current policy: randomly select one of the offers
 java.util.Vector<Template> applyTemplateSelectionPolicy(java.util.Vector<Template> templates, AgreementOffer request)
          Policy is: keep a list of known HMs in memory.
static void main(java.lang.String[] args)
          Main method for testing this domain policy
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

runtimeDomainPolicy

public runtimeDomainPolicy()
Method Detail

applyTemplateSelectionPolicy

public java.util.Vector<Template> applyTemplateSelectionPolicy(java.util.Vector<Template> templates,
                                                               AgreementOffer request)
                                                        throws PolicyException
Policy is: keep a list of known HMs in memory. Use a round robin scheme to determine which HM template is to be used to for each request. If a new template is present (a host has been added), add it to the internal list, at the end of the list.

Specified by:
applyTemplateSelectionPolicy in class DomainPolicy
Parameters:
templates -
request -
Returns:
Vector with templates
Throws:
PolicyException

applyHostOfferSelectionPolicy

public java.util.Vector<AgreementOffer> applyHostOfferSelectionPolicy(AgreementOffer ao,
                                                                      java.util.Vector<AgreementOffer> leaseOffers)
Current policy: randomly select one of the offers

Specified by:
applyHostOfferSelectionPolicy in class DomainPolicy
Parameters:
leaseOffers -
Returns:
Vector containing one random offer from the supplied vector

main

public static void main(java.lang.String[] args)
Main method for testing this domain policy

Parameters:
args - This method creates a number of dummy templates, and in each cycle passes a random subset of these templates to the policy. The number of assigned requests to each host is shown in a bar graph

reset

public void reset()
Specified by:
reset in class DomainPolicy


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.