p3j.pppm.sets
Class SetType

java.lang.Object
  extended by p3j.pppm.sets.SetType
All Implemented Interfaces:
Serializable

public class SetType
extends Object
implements Serializable

Represents a Settype. Basically, a Settype defines a list of ParameterInstance objects. This list represents parameter instances that loosely depend on each other. Each element of this list is exclusive to one Settype (by default, this is the default Settype, see ProjectionModel ), i.e., the parameter instance lists of all Settypes are disjunct. Each Set of a SetType contains a list of ParameterAssignment objects for each instances and has an occurrence probability itself. Hence, the Monte-Carlo simulation firstly selects a Set for each SetType randomly, and then selects a ParameterAssignment from the options offered by the chosen Set, for each ParameterInstance that is defined in the SetType. Basically, Set and SetType serve the purpose of avoiding implausible combinations of input matrices for the PPPM (e.g., high fertility of native population and immigrants, but low fertility of emigrants could be such a combination). Each Settype manages the list of Set instances that are associated with it. Hence, sets need to be added/removed from the Settype. Created on August 7, 2006

Author:
Christina Bohk, Roland Ewald
See Also:
Set, ProjectionModel, ParameterAssignment, Serialized Form

Constructor Summary
SetType()
          Constructor for bean compatibility.
SetType(String typeName, String typeDescription)
          Default constructor.
 
Method Summary
 void addInstance(ParameterInstance instance)
          Adds a parameter instance for this Settype.
 Set createSet(String setName, String setDescription, double probability)
          Creates a new set for a type.
 List<ParameterInstance> getDefinedParameters()
           
 String getDescription()
           
 int getID()
           
 String getName()
           
 int getNumOfSets()
          Gets the number of sets for this Settype.
 List<Set> getSets()
           
 void removeInstance(ParameterInstance instance)
          Removes a parameter instance from this Settype.
 boolean removeSet(Set set)
          Removes a set from this Settype.
 void setDefinedParameters(List<ParameterInstance> definedParameters)
           
 void setDescription(String description)
           
 void setID(int uniqueID)
           
 void setName(String name)
           
 void setSets(List<Set> sets)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetType

public SetType(String typeName,
               String typeDescription)
Default constructor.

Parameters:
typeName - name of the Settype
typeDescription - description for this Settype

SetType

public SetType()
Constructor for bean compatibility.

Method Detail

createSet

public Set createSet(String setName,
                     String setDescription,
                     double probability)
Creates a new set for a type.

Parameters:
setName - name of the set to be created
setDescription - description of the set to be created
probability - probability of the set to be created
Returns:
the newly created set

removeSet

public boolean removeSet(Set set)
Removes a set from this Settype.

Parameters:
set - the set to be removed
Returns:
true, if set could be removed; otherwise false

removeInstance

public void removeInstance(ParameterInstance instance)
Removes a parameter instance from this Settype. Removes all ParameterAssignment objects from all Set objects associated with this Settype.

Parameters:
instance - the instance to be removed

addInstance

public void addInstance(ParameterInstance instance)
Adds a parameter instance for this Settype. Updates all associated Set objects as well.

Parameters:
instance - the instance to be added

toString

public String toString()
Overrides:
toString in class Object

setDefinedParameters

public void setDefinedParameters(List<ParameterInstance> definedParameters)

setSets

public void setSets(List<Set> sets)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getName

public String getName()

setName

public void setName(String name)

getDefinedParameters

public List<ParameterInstance> getDefinedParameters()

getSets

public List<Set> getSets()

getNumOfSets

public int getNumOfSets()
Gets the number of sets for this Settype.

Returns:
the number of sets

getID

public int getID()

setID

public void setID(int uniqueID)


Copyright © 2012. All Rights Reserved.