nicfel / CoupledMCMC

Adaptive parallel tempering for Beast2
GNU General Public License v3.0
7 stars 4 forks source link

Some unwanted input replacements (like "target") can cause trouble #16

Closed rbouckaert closed 3 years ago

rbouckaert commented 3 years ago

The CoupledMCMC class replaces all attributes to change XML from a CoupledMCMC to a HeatedMCMC one. If a class happens to use the same input name (like "target") that gets removed from the MCMC, but may be an essential input to the package class.

By replacing replaceAll with replaceFirst in CoupledMCMC.initRun it won't happen any more.

rbouckaert commented 3 years ago

35d4ac0 assumes the target attribute is specified in the CoupledMCMC element. If this is not the case, it still replaces the wrong attribute. A more robust solution is to get away from String manipulation and create a HeatedChain object, the call initByName on it with inputs (like distribution, operator, etc.) from CoupledMCMC.