Skip to content

Input should be able to construct typed constants from a String #35

@rbouckaert

Description

@rbouckaert

Currently, Inputs of Function can be encoded in the XML without having to explicitly create an XML element of a class that implements Function. For example, the kappa parameter for the HKY model can be encoded as <substModel spec="HKY" kappa="2.0"/> instead of

<substModel spec="HKY">
     <kappa spec="RealParameter" value="2.0"/>
</substModel>

The strongly typed version of HKY does not have kappa as a function but as a RealScalar<PositiveReal>, so you have to use something like

<substModel spec="HKY">
     <kappa spec="RealScalarParam" domain="PositiveReal" value="2.0"/>
</substModel>

which is even more verbose. It would be good if we could use <substModel spec="HKY" kappa="2.0"/> to make this work.
The Input.setStrinValue method may need to be updated to recognise RealScalars and other primitive types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions