spis.Surf.InteractModel
Class ParamSetExtractor

java.lang.Object
  extended byspis.Surf.InteractModel.ParamSetExtractor

public class ParamSetExtractor
extends java.lang.Object

Class Name : ParamSetExtractor (generic Parameter Set Extractor class)
Project ref : SPIS project
File name : ModelParamSetExtractor.java
File type : class
Copyright : ONERA, 2 Av. E. Belin, 31055 Toulouse cedex, France http://www.onecert.fr
Status : under development
Creation : 25/08/2003
Modification :

Description : generic Parameter Set Extractor class
All classes of parameters sets extractors must derive from this class.
An extractor generates the Parameters of an Interactor from the Model Parameters of an Interaction/Material Model.
This is often very simple, as e.g. extracting the parameters relevant to SEE within NASCAP parameter list and passing them to SEE interactor.
In practice this must be done by overriding the extract method with the a specific one (the SpisRuntimeException generated in the generic extract method of this generic ParamSetExtractor class will thus only be thrown in case of wrong Parameters Set classes passed to the extract method).

Versions and anomalies correction :

Version numberAuthor (name, e-mail) Corrections/Modifications
0.1 JF Roussel, roussel@onecert.frCreation


Version:
0.1
Author:
JF Roussel

Field Summary
private  int[] extractPositions
          positions (indices) of the objects to be extracted int the paramter array
private  float[] factors
          factors the extracted paramaters must be multipled by (n-th extracted parameter is multiplied by factors[i] (it this parameter type allows it, only for Float currently))
 
Constructor Summary
ParamSetExtractor(int position)
          Simplified constructor, to extract one single parameter, of index passed
ParamSetExtractor(int[] extractPositions_)
          Default constructor
ParamSetExtractor(int[] extractPositions_, float[] factors_)
          Constructor with extra factors
 
Method Summary
 ParameterSet extract(ParameterSet set)
          Extracts a subset defined as some elements of the array.
 ParameterSet[] extract(ParameterSet[] sets)
          Does the same job as extract(ParameterSet set) but for arrays of paramater sets: extracts and returns subsets of parameters to be used by an Interactor (as ParameterSet[]) from sets of a MaterialModel parameters (as ParameterSet[]) or to be used by a Function (as ParameterSet[]) from sets of Interactor parameters (as a ParameterSet[])
private  void noFactors()
          sets factors to 1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

extractPositions

private int[] extractPositions
positions (indices) of the objects to be extracted int the paramter array


factors

private float[] factors
factors the extracted paramaters must be multipled by (n-th extracted parameter is multiplied by factors[i] (it this parameter type allows it, only for Float currently))

Constructor Detail

ParamSetExtractor

public ParamSetExtractor(int[] extractPositions_)
Default constructor

Parameters:
extractPositions_ - indices of the object to be extracted from the array

ParamSetExtractor

public ParamSetExtractor(int[] extractPositions_,
                         float[] factors_)
Constructor with extra factors

Parameters:
extractPositions_ - indices of the object to be extracted from the array

ParamSetExtractor

public ParamSetExtractor(int position)
Simplified constructor, to extract one single parameter, of index passed

Parameters:
position - position of the single parameter tobe extracted
Method Detail

noFactors

private void noFactors()
sets factors to 1


extract

public ParameterSet extract(ParameterSet set)
Extracts a subset defined as some elements of the array. Does not copy the objects, the returned ParameterSet objects will make a reference to the the input ParameterSet objects.

See Also:
ParamSetExtractorInterfaceDeprecated#extract(ParameterSet)

extract

public ParameterSet[] extract(ParameterSet[] sets)
Does the same job as extract(ParameterSet set) but for arrays of paramater sets: extracts and returns subsets of parameters to be used by an Interactor (as ParameterSet[]) from sets of a MaterialModel parameters (as ParameterSet[]) or to be used by a Function (as ParameterSet[]) from sets of Interactor parameters (as a ParameterSet[])

Parameters:
sets - input parameter sets (ParameterSet[])
Returns:
the extracted sets (InteractorParamSet[])
See Also:
extract(ParameterSet)