edu.usc.cse.desi.generate
Class Generator

java.lang.Object
  extended byedu.usc.cse.desi.generate.Generator

public class Generator
extends java.lang.Object

This class generates new systems from given input values.

Author:
NeLs Started on Jul 30, 2004
See Also:
InputData

Constructor Summary
Generator()
           
 
Method Summary
static void checkComponentsFit(DESIDataModel model)
           
static void checkComponentsFit(DESIViewModel model)
          This is a utility method that can be used to make sure that the components fit on their hosts (memory-wise).
static DESIViewModel generate(InputData input, PropertyInitializer prop_init)
          This method generates a new System based on the parameters it is given as input.
private static java.lang.Object generateInRange(java.lang.String max, java.lang.String min, java.lang.String type, java.util.Random rand)
          This method generates a random number between min and max of the given type and returns it as one of the primitive wrappers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Generator

public Generator()
Method Detail

generate

public static DESIViewModel generate(InputData input,
                                     PropertyInitializer prop_init)
                              throws NoValidDeploymentException
This method generates a new System based on the parameters it is given as input. However, if any of these paramters are invalid, this method will return null.

Parameters:
input -
prop_init - PropertyInitializer - In order to create a new model, we need to know what properties are being used.
Returns:
DESIViewModel a newly generated system or null if the paremeters are incorrect.
Throws:
NoValidDeploymentException

checkComponentsFit

public static void checkComponentsFit(DESIViewModel model)
                               throws NoValidDeploymentException
This is a utility method that can be used to make sure that the components fit on their hosts (memory-wise).

Parameters:
model - DESIDataModel - The model object.
Throws:
NoValidDeploymentException - Thrown if the components do not fit on the hosts.

checkComponentsFit

public static void checkComponentsFit(DESIDataModel model)
                               throws NoValidDeploymentException
Throws:
NoValidDeploymentException

generateInRange

private static java.lang.Object generateInRange(java.lang.String max,
                                                java.lang.String min,
                                                java.lang.String type,
                                                java.util.Random rand)
This method generates a random number between min and max of the given type and returns it as one of the primitive wrappers. You must also pass it a Random class just so that it doesn't have to create its own.

Parameters:
max -
min -
type -
rand -
Returns: