public class ProjectionModel extends james.core.model.Model implements IProjectionModel
Set
objects
associated with different SetType
instances. Such a scenario can be
used for forecasting, it comprises all information necessary for basic
repeatibility of the Monte-Carlo-simulation. Each scenario holds a list of
all ParameterInstance
objects that need an assignment. Disjunct
subsets of this list will be managed by SetType
.
TODO: Store RNG seed to ensure exact reproducibility.
Created on January 22, 2007Constructor and Description |
---|
ProjectionModel()
Constructor for bean compatibility (do NOT use manually!).
|
ProjectionModel(String scenName,
String desc,
int numOfGenerations,
int predYears,
int maxAge,
int jumpOffYear)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
assignParameterInstance(ParameterInstance instance,
SetType type,
boolean migrate)
Assign a
ParameterInstance to a specific SetType . |
int |
countNumberOfParameterAssignments()
Counts the number of parameter assignments contained in this projection.
|
SetType |
createSetType(String stName,
String stDesc)
Defines a new Settype for this scenario.
|
List<ParameterInstance> |
getAllParameterInstances()
Gets the all parameter instances.
|
List<SetType> |
getAllSetTypes()
Returns list of all
SetType objects, the custom ones and the
default one. |
Set |
getDefaultSet()
Gets the default set.
|
SetType |
getDefaultSetType()
Gets the default Settype.
|
SetType |
getDefaultType()
Gets the default type.
|
String |
getDescription()
Gets the description.
|
int |
getGenerations()
Gets the number of projected generations.
|
int |
getID()
Gets the id.
|
Map<ParameterInstance,SetType> |
getInstanceSetTypes()
Gets the map parameter instance => Settype.
|
int |
getJumpOffYear()
Gets the jump off year.
|
int |
getMaximumAge()
Gets the maximum age.
|
String |
getName() |
int |
getNumberOfAgeClasses()
Gets the number of age classes.
|
int |
getNumOfSetTypes()
Gets the number of (user-defined) of Settypes.
|
SetType |
getSetType(int index)
Retrieves a custom
SetType . |
List<ParameterInstance> |
getUnassignedParameterInstances()
Get all
ParameterInstance objects that still belong to the default
SetType . |
List<SetType> |
getUserDefinedTypes()
Gets the user defined types.
|
int |
getYears()
Gets the number of projected years.
|
void |
init()
Initializes projection.
|
boolean |
removeParameterInstanceAssignment(ParameterInstance instance)
Removes a
ParameterInstance from a certain SetType . |
boolean |
removeSetType(int index)
Removes
SetType with given index from scenario. |
boolean |
removeSetType(SetType setType)
Removes the Settype.
|
void |
setAllParameterInstances(List<ParameterInstance> allParameterInstances)
Sets the all parameter instances.
|
void |
setDefaultSet(Set defaultSet)
Sets the default set.
|
void |
setDefaultType(SetType defaultType)
Sets the default type.
|
void |
setDescription(String description)
Sets the description.
|
void |
setGenerations(int generations)
Sets the generations.
|
void |
setID(int uniqueID)
Sets the id.
|
void |
setInstanceSetTypes(Map<ParameterInstance,SetType> instanceSetTypes)
Sets the instance Settypes.
|
void |
setJumpOffYear(int jumpOffYear)
Sets the jump off year.
|
void |
setMaximumAge(int maximumAge)
Sets the maximum age.
|
void |
setName(String name) |
void |
setUserDefinedTypes(List<SetType> userDefinedTypes)
Sets the user defined types.
|
void |
setYears(int years)
Sets the years.
|
cleanUp, demandsResource, getParam, getParam, instantiate, setAccessRestriction, setParam
changed, changed, getMediator, getSimpleId, isObserved, registerObserver, report, report, report, report, report, report, report, report, setMediator, unregister, unregisterObserver, unregisterObservers
public ProjectionModel()
public ProjectionModel(String scenName, String desc, int numOfGenerations, int predYears, int maxAge, int jumpOffYear)
scenName
- name of the scenariodesc
- description of the scenarionumOfGenerations
- number of generations to be consideredpredYears
- number of years to be predictedmaxAge
- maximum age to be consideredjumpOffYear
- the jump off yearpublic void init()
allParameterInstances
has been initialized.init
in interface james.core.model.IModel
init
in class james.core.model.Model
public SetType createSetType(String stName, String stDesc)
stName
- name of the SettypestDesc
- description of the Settypepublic List<ParameterInstance> getUnassignedParameterInstances()
ParameterInstance
objects that still belong to the default
SetType
. These have not yet been assigned to any custom
SetType
.public boolean assignParameterInstance(ParameterInstance instance, SetType type, boolean migrate)
ParameterInstance
to a specific SetType
.instance
- the parameter instance to be assignedtype
- the SetType
that shall manage the
ParameterInstance
from now onmigrate
- flag to switch migration of existing assumption to new Settype
on/offpublic boolean removeParameterInstanceAssignment(ParameterInstance instance)
ParameterInstance
from a certain SetType
.instance
- the instance that should from now on be managed by the default
SetType
public SetType getSetType(int index)
SetType
.index
- index of the Settypepublic boolean removeSetType(int index)
SetType
with given index from scenario.index
- index of the Settypepublic List<SetType> getAllSetTypes()
IProjectionModel
SetType
objects, the custom ones and the
default one.getAllSetTypes
in interface IProjectionModel
SetType
objects defined in this scenario (at
least the default SetType
is defined)public Set getDefaultSet()
public void setDefaultSet(Set defaultSet)
defaultSet
- the new default setpublic SetType getDefaultType()
public void setDefaultType(SetType defaultType)
defaultType
- the new default typepublic SetType getDefaultSetType()
public int getGenerations()
IProjectionModel
getGenerations
in interface IProjectionModel
public void setGenerations(int generations)
generations
- the new generationspublic int getMaximumAge()
IProjectionModel
getMaximumAge
in interface IProjectionModel
public void setMaximumAge(int maximumAge)
maximumAge
- the new maximum agepublic int getYears()
IProjectionModel
getYears
in interface IProjectionModel
public void setYears(int years)
years
- the new yearspublic List<SetType> getUserDefinedTypes()
public void setUserDefinedTypes(List<SetType> userDefinedTypes)
userDefinedTypes
- the new user defined typespublic List<ParameterInstance> getAllParameterInstances()
public void setAllParameterInstances(List<ParameterInstance> allParameterInstances)
allParameterInstances
- the new all parameter instancespublic Map<ParameterInstance,SetType> getInstanceSetTypes()
IProjectionModel
getInstanceSetTypes
in interface IProjectionModel
public void setInstanceSetTypes(Map<ParameterInstance,SetType> instanceSetTypes)
instanceSetTypes
- the instance Settypespublic boolean removeSetType(SetType setType)
setType
- the Settypepublic int getNumOfSetTypes()
public int getID()
public void setID(int uniqueID)
uniqueID
- the new idpublic String getName()
getName
in interface james.core.base.INamedEntity
getName
in class james.core.base.NamedEntity
public void setName(String name)
setName
in interface james.core.base.INamedEntity
setName
in class james.core.base.NamedEntity
public String getDescription()
public void setDescription(String description)
description
- the new descriptionpublic int getNumberOfAgeClasses()
maximumAge
.public int getJumpOffYear()
public void setJumpOffYear(int jumpOffYear)
jumpOffYear
- the new jump off yearpublic int countNumberOfParameterAssignments()
Copyright © 2012. All Rights Reserved.