edu.usc.cse.desi.algorithm
Class ExactAlgorithm

java.lang.Object
  extended byedu.usc.cse.desi.algorithm.AbstractAlgorithm
      extended byedu.usc.cse.desi.algorithm.ExactAlgorithm

public class ExactAlgorithm
extends AbstractAlgorithm

Here is the exact algorithm. It is pretty slow at least in terms of its order. (and also in terms of its execution, making it slow in every possible way.)

Author:
NeLs Started on Aug 9, 2004

Field Summary
private  DESIViewModel myBestDeployment
           
private  double myMaxAvailability
           
 
Constructor Summary
ExactAlgorithm()
           
 
Method Summary
private  void addFixedComponents(java.util.List list_of_comps)
          This method will, given a list of component view models, will add all these components to their required hosts.
private  void checkConstraintsAreSatisfied(DESIViewModel model)
          This method does what its name says.
protected  DESIViewModel executeAlgo(DESIViewModel cur_model)
          Here we execute the exact algorithm.
private  void removeComponentsFromHosts(java.util.List list_of_hosts, DESIViewModel desi_model)
          A method meant to only be called by this class, if you pass it a list of host data models and it will remove all of their components.
 
Methods inherited from class edu.usc.cse.desi.algorithm.AbstractAlgorithm
run, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myMaxAvailability

private double myMaxAvailability

myBestDeployment

private DESIViewModel myBestDeployment
Constructor Detail

ExactAlgorithm

public ExactAlgorithm()
Method Detail

executeAlgo

protected DESIViewModel executeAlgo(DESIViewModel cur_model)
Here we execute the exact algorithm. In short, we try every possible combination and see which one is the best. I overrode this method:

Specified by:
executeAlgo in class AbstractAlgorithm
Parameters:
cur_model - DESIViewModel - The current model of the system.
Returns:
DESIViewModel - The affected model of the system.
See Also:
AbstractAlgorithm.executeAlgo(edu.usc.cse.desi.model.view.DESIViewModel)

removeComponentsFromHosts

private void removeComponentsFromHosts(java.util.List list_of_hosts,
                                       DESIViewModel desi_model)
A method meant to only be called by this class, if you pass it a list of host data models and it will remove all of their components.


addFixedComponents

private void addFixedComponents(java.util.List list_of_comps)
This method will, given a list of component view models, will add all these components to their required hosts.

Parameters:
list_of_comps -

checkConstraintsAreSatisfied

private void checkConstraintsAreSatisfied(DESIViewModel model)
                                   throws NoValidDeploymentException
This method does what its name says. THis has to be THE slowest possible way to do this, but I guess that's in keeping with out ultra-slow exact algorithm.

Parameters:
model -
Throws:
NoValidDeploymentException