int version = -1;
if (container != null) {
level = container.getLevel();
version = container.getVersion();
}
UnitsCompiler compiler = null;
if (isSetParentSBMLObject()) {
Model model = getParentSBMLObject().getModel();
compiler = new UnitsCompiler(model);
}
if (compiler == null) {
compiler = new UnitsCompiler(level, version);
}
return compile(compiler).getUnits().simplify();
}