#include "api2/Types.idl" module CipresIDL_api2 { typedef UID ParamID; typedef UID ExprID; /* Wrapping enums in modules makes the mapping cleaner, because the enum facets get dumped into their module's namespace. Inside the module "const short" is used instead of an enum because of a JacORB bug (see Cipres.idl line 31). */ module ParamScope { const short GLOBAL = 0; const short SUBSET = 1; const short EDGE = 2; const short EDGE_SUBSET = 3; }; typedef short ParamScopeCategory; module ParamValue { const short MARGINALIZED = 0; const short FIXED_VALUE = 1; const short TO_ESTIMATE = 2; const short ESTIMATED = 3; }; typedef short ParamValueCategory; module NumericBound { const short NONE = 0; const short OPEN = 1; const short CLOSED = 2; }; typedef short NumericBoundCategory; struct Bound { NumericBoundCategory type; double value; }; struct Parameter { ParamID id; string name; ParamScopeCategory scope; ParamValueCategory valueMeaning; double value; Bound lower; Bound upper; }; module OpCode { const short CONSTANT_VALUE = 0; const short PARAMETER_VALUE = 1; const short NEGATE = 2; const short ADDITION = 3; const short DIVISION = 4; const short MULTIPLICATION = 5; const short SUBTRACTION = 6; }; typedef short OperationCode; #if defined (REVERSE_POLISH) struct ExpressionTerm { OperationCode opCode; UID paramRef; // id of the parameter }; struct Expression { ExprID id; sequence expr; // reverse polish notation }; #else //defined (REVERSE_POLISH) # if !defined(JACORB_HAS_BROKEN_FORWARD_DECL) struct Expression; typedef sequence ExpressionSequence; # endif struct Expression { ExprID id; // unique ID for this expression OperationCode opCode; // UID paramRef; // id of the parameter float val; # if defined(JACORB_HAS_BROKEN_FORWARD_DECL) sequence expr; # else ExpressionSequence expr; # endif }; #endif //defined (REVERSE_POLISH) struct ProbabilityDensity { sequence densityParams; //@needs to be ExprID instead of double, needs to be renamed }; struct Prior { ProbabilityDensity dist; sequence parameters; }; module ParamConstraint { const short SUM_EQUALS_VALUE = 0; const short MEAN_EQUALS_VALUE = 1; }; typedef short ParamConstraintCategory; struct ParameterConstraint { ParamConstraintCategory paramConstraintCateg; double value; sequence parameters; }; module ModelEncoding { const short Q_MATRIX = 0; //all expressions are in the QMatrix field of the DiscreteCharacterModel const short SYMM_COMPONENT_MATRIX = 1; // use qMatrix and symmComponentOfQMatrix const short MIXTURE = 2; }; typedef short ModelEncodingCategory; #if !defined(JACORB_HAS_BROKEN_FORWARD_DECL) struct DiscreteCharacterModel; typedef sequence DiscreteCharacterModelSeq; #endif struct DiscreteCharacterModel { UID datatypeReference; /* Describes the type of data that the model can be applied to. a datatype object can be one of the common types or a description of constraints (e.g. 4-state) */ #if 0 boolean isReversible; sequence expressions; sequence parameters; ModelEncodingCategory descriptionType; /* serves as a discriminator for which fields to read*/ sequence< sequence > qMatrix; /** used if descriptionType == Q_MATRIX */ sequence< sequence > symmComponentOfQMatrix; /** used if descriptionType == SYMM_COMPONENT_MATRIX */ sequence equilStateFreq; /** used if descriptionType == SYMM_COMPONENT_MATRIX */ sequence constraints; sequence priors; # if defined(JACORB_HAS_BROKEN_FORWARD_DECL) sequence subModels; /** used if descriptionType == MIXTURE */ # else DiscreteCharacterModelSeq subModels; # endif sequence mixtureProportions; Prior mixtureProportionPrior; ExprID rateMultiplier; #endif }; interface ModelSupplier { short ping(in short x); DiscreteCharacterModel getModel(in DiscreteCharacterModel mod); }; };