Search in sources :

Example 6 with ParticleMolecularType

use of cbit.vcell.math.ParticleMolecularType in project vcell by virtualcell.

the class XmlReader method getParticleMolecularTypePattern.

private ParticleMolecularTypePattern getParticleMolecularTypePattern(Element param, MathDescription mathDescription) throws XmlParseException {
    String molecularTypeName = unMangle(param.getAttributeValue(XMLTags.NameAttrTag));
    String matchLabel = unMangle(param.getAttributeValue(XMLTags.ParticleMolecularTypePatternMatchLabelAttrTag));
    ParticleMolecularType particleMolecularType = mathDescription.getParticleMolecularType(molecularTypeName);
    if (particleMolecularType != null) {
        ParticleMolecularTypePattern var = new ParticleMolecularTypePattern(particleMolecularType);
        if (matchLabel != null) {
            var.setMatchLabel(matchLabel);
        }
        List<Element> componentPatternList = param.getChildren(XMLTags.ParticleMolecularComponentPatternTag, vcNamespace);
        for (Element componentPattern : componentPatternList) {
            ParticleMolecularComponentPattern p = getParticleMolecularComponentPattern(componentPattern, particleMolecularType);
            var.addMolecularComponentPattern(p);
        }
        return var;
    } else {
        throw new XmlParseException("failed to find ParticleMolecularType named " + molecularTypeName);
    }
}
Also used : ParticleMolecularComponentPattern(cbit.vcell.math.ParticleMolecularComponentPattern) Element(org.jdom.Element) ParticleMolecularType(cbit.vcell.math.ParticleMolecularType) ParticleMolecularTypePattern(cbit.vcell.math.ParticleMolecularTypePattern)

Aggregations

ParticleMolecularType (cbit.vcell.math.ParticleMolecularType)6 Element (org.jdom.Element)5 ParticleMolecularComponent (cbit.vcell.math.ParticleMolecularComponent)3 ParticleMolecularComponentPattern (cbit.vcell.math.ParticleMolecularComponentPattern)3 ParticleMolecularTypePattern (cbit.vcell.math.ParticleMolecularTypePattern)3 CompartmentSubDomain (cbit.vcell.math.CompartmentSubDomain)2 MacroscopicRateConstant (cbit.vcell.math.MacroscopicRateConstant)2 ParticleComponentStateDefinition (cbit.vcell.math.ParticleComponentStateDefinition)2 ParticleComponentStatePattern (cbit.vcell.math.ParticleComponentStatePattern)2 Variable (cbit.vcell.math.Variable)2 VolumeParticleSpeciesPattern (cbit.vcell.math.VolumeParticleSpeciesPattern)2 ArrayList (java.util.ArrayList)2 BioEvent (cbit.vcell.mapping.BioEvent)1 Action (cbit.vcell.math.Action)1 Constant (cbit.vcell.math.Constant)1 Event (cbit.vcell.math.Event)1 FilamentRegionVariable (cbit.vcell.math.FilamentRegionVariable)1 FilamentSubDomain (cbit.vcell.math.FilamentSubDomain)1 FilamentVariable (cbit.vcell.math.FilamentVariable)1 Function (cbit.vcell.math.Function)1