org.dbe.eve.factories.smefactory
Class OverallServicePool

java.lang.Object
  extended by org.dbe.eve.factories.smefactory.OverallServicePool

public class OverallServicePool
extends java.lang.Object

OverallServicePool for the SMEFactory either services or groupedservices can be stored number of Services which is set by the GUI is stored in it

Since:
23th of November 2006
Author:
Christoph Adelberger

Field Summary
private static OverallServicePool instance
           
(package private) static org.apache.log4j.Logger logger
           
private  EvEModel model
           
(package private) static MersenneTwister mt
           
private  java.util.Vector overallServicePool
           
 
Constructor Summary
private OverallServicePool()
           
 
Method Summary
private  void addService(Service service)
          adds a service to the overallservicepool
static OverallServicePool getInstofOverallServicePool()
          constructs an overallservicepool or returns the instance of it
 EvEModel getModel()
           
 java.util.Vector getOverallServicePool()
           
 Service getRandomService()
          returns a random services from the overallservicepool
 java.util.Vector getRandomServices(int num)
          returns random services from the overallservicepool
 java.util.Vector getRandomServicesFromGroup(int group, int num)
          returns random services from the overallservicepool from a given group
 void reinitialiseOSP(int numberOfServices)
          refills the overallServicePool with a defined number of new services gets service from the servicefactory and adds them to the overallservicepool
 void setModel(EvEModel model)
           
 void setOverallServicePool(java.util.Vector overallServicePool)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static OverallServicePool instance

overallServicePool

private java.util.Vector overallServicePool

model

private EvEModel model

mt

static MersenneTwister mt

logger

static org.apache.log4j.Logger logger
Constructor Detail

OverallServicePool

private OverallServicePool()
Method Detail

getInstofOverallServicePool

public static OverallServicePool getInstofOverallServicePool()
constructs an overallservicepool or returns the instance of it

Parameters:
eVeModel - instance of an EvEModel
Returns:
OverallServicePool

reinitialiseOSP

public void reinitialiseOSP(int numberOfServices)
refills the overallServicePool with a defined number of new services gets service from the servicefactory and adds them to the overallservicepool

Parameters:
numberOfServices -

addService

private void addService(Service service)
adds a service to the overallservicepool

Parameters:
service -

getRandomService

public Service getRandomService()
returns a random services from the overallservicepool

Returns:
Service

getRandomServices

public java.util.Vector getRandomServices(int num)
returns random services from the overallservicepool

Returns:
Service Vector

getRandomServicesFromGroup

public java.util.Vector getRandomServicesFromGroup(int group,
                                                   int num)
returns random services from the overallservicepool from a given group

Returns:
Service Vector

getModel

public EvEModel getModel()

setModel

public void setModel(EvEModel model)

getOverallServicePool

public java.util.Vector getOverallServicePool()

setOverallServicePool

public void setOverallServicePool(java.util.Vector overallServicePool)