LPhyBEAST is a project that takes an LPhy model specification,
and some data and produces a BEAST 2 XML input file.
It is separately distributed as a BEAST 2 package,
and the source code is available at https://github.com/LinguaPhylo/LPhyBeast.
More technical details are available at LPhyBEAST developer note.
Most of LPhy Value or Generator can be directly converted to an equivalent BEAST 2 object.
To do so, it needs to create a concrete Java class that implements the respective interface,
namely either ValueToBEAST<T, S extends BEASTInterface>
or GeneratorToBEAST<T extends Generator, S extends BEASTInterface>.
The type T in ValueToBEAST is a (LPhy) data type wrapped by Value<T>,
but in GeneratorToBEASTT is a Generator (mostly GenerativeDistribution) that generates Value.
The type S will be the BEAST 2 object to be created eventually in both cases.
However, sometimes there is no directly mapping between LPhy and BEAST 2 objects.
In this circumstance, we have to either create some intermediate BEAST 2 objects
in order to generate the correct BEAST 2 XML,
or remove some “unnecessary” BEAST 2 objects created by the above “auto-mapping” mechanism
to generate a particular XML section.
In addition, there are two validations to check if any LPhy Value and Generator
parsed from scripts have their ValueToBEAST or GeneratorToBEAST being implemented.
So, the utility class lphybeast.Exclusion is used to exclude those LPhy Value and Generator
that do not need to map to BEAST 2 objects,
which avoids throwing UnsupportedOperationException from the validation.