Search in sources :

Example 1 with ExplicitDataGenerator

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

the class XmlReader method getExplicitDataGenerator.

private ExplicitDataGenerator getExplicitDataGenerator(Element element) {
    String name = unMangle(element.getAttributeValue(XMLTags.NameAttrTag));
    String domainStr = unMangle(element.getAttributeValue(XMLTags.DomainAttrTag));
    Domain domain = null;
    if (domainStr != null) {
        domain = new Domain(domainStr);
    }
    String temp = element.getText();
    Expression exp = unMangleExpression(temp);
    ExplicitDataGenerator explicitDataGenerator = new ExplicitDataGenerator(name, domain, exp);
    return explicitDataGenerator;
}
Also used : Expression(cbit.vcell.parser.Expression) ExplicitDataGenerator(cbit.vcell.math.ExplicitDataGenerator) MembraneSubDomain(cbit.vcell.math.MembraneSubDomain) CompartmentSubDomain(cbit.vcell.math.CompartmentSubDomain) FilamentSubDomain(cbit.vcell.math.FilamentSubDomain) PointSubDomain(cbit.vcell.math.PointSubDomain) Domain(cbit.vcell.math.Variable.Domain)

Example 2 with ExplicitDataGenerator

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

the class Xmlproducer method getXML.

private Element getXML(PostProcessingBlock postProcessingBlock) {
    Element element = new Element(XMLTags.PostProcessingBlock);
    for (DataGenerator dataGenerator : postProcessingBlock.getDataGeneratorList()) {
        if (dataGenerator instanceof ExplicitDataGenerator) {
            Element e = new Element(XMLTags.ExplicitDataGenerator);
            e.setAttribute(XMLTags.NameAttrTag, mangle(dataGenerator.getName()));
            if (dataGenerator.getDomain() != null) {
                e.setAttribute(XMLTags.DomainAttrTag, mangle(dataGenerator.getDomain().getName()));
            }
            e.addContent(mangleExpression(dataGenerator.getExpression()));
            element.addContent(e);
        } else if (dataGenerator instanceof ProjectionDataGenerator) {
            element.addContent(getXML((ProjectionDataGenerator) dataGenerator));
        } else if (dataGenerator instanceof ConvolutionDataGenerator) {
            element.addContent(getXML((ConvolutionDataGenerator) dataGenerator));
        }
    }
    return element;
}
Also used : Element(org.jdom.Element) DataGenerator(cbit.vcell.math.DataGenerator) ExplicitDataGenerator(cbit.vcell.math.ExplicitDataGenerator) ConvolutionDataGenerator(cbit.vcell.math.ConvolutionDataGenerator) ProjectionDataGenerator(cbit.vcell.math.ProjectionDataGenerator) ConvolutionDataGenerator(cbit.vcell.math.ConvolutionDataGenerator) ProjectionDataGenerator(cbit.vcell.math.ProjectionDataGenerator) ExplicitDataGenerator(cbit.vcell.math.ExplicitDataGenerator)

Example 3 with ExplicitDataGenerator

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

the class XmlReader method getPostProcessingBlock.

private void getPostProcessingBlock(MathDescription mathDesc, Element element) throws XmlParseException {
    Iterator<Element> iterator = element.getChildren(XMLTags.ExplicitDataGenerator, vcNamespace).iterator();
    while (iterator.hasNext()) {
        Element tempelement = (Element) iterator.next();
        ExplicitDataGenerator explicitDataGenerator = getExplicitDataGenerator(tempelement);
        try {
            mathDesc.getPostProcessingBlock().addDataGenerator(explicitDataGenerator);
        } catch (MathException e) {
            throw new XmlParseException(e);
        }
    }
    iterator = element.getChildren(XMLTags.ProjectionDataGenerator, vcNamespace).iterator();
    while (iterator.hasNext()) {
        Element tempelement = (Element) iterator.next();
        ProjectionDataGenerator projectionDataGenerator = getProjectionDataGenerator(tempelement);
        try {
            mathDesc.getPostProcessingBlock().addDataGenerator(projectionDataGenerator);
        } catch (MathException e) {
            throw new XmlParseException(e);
        }
    }
    iterator = element.getChildren(XMLTags.ConvolutionDataGenerator, vcNamespace).iterator();
    while (iterator.hasNext()) {
        Element tempelement = (Element) iterator.next();
        ConvolutionDataGenerator convolutionDataGenerator = getConvolutionDataGenerator(tempelement);
        try {
            mathDesc.getPostProcessingBlock().addDataGenerator(convolutionDataGenerator);
        } catch (MathException e) {
            throw new XmlParseException(e);
        }
    }
}
Also used : MathException(cbit.vcell.math.MathException) Element(org.jdom.Element) ConvolutionDataGenerator(cbit.vcell.math.ConvolutionDataGenerator) ProjectionDataGenerator(cbit.vcell.math.ProjectionDataGenerator) ExplicitDataGenerator(cbit.vcell.math.ExplicitDataGenerator)

Aggregations

ExplicitDataGenerator (cbit.vcell.math.ExplicitDataGenerator)3 ConvolutionDataGenerator (cbit.vcell.math.ConvolutionDataGenerator)2 ProjectionDataGenerator (cbit.vcell.math.ProjectionDataGenerator)2 Element (org.jdom.Element)2 CompartmentSubDomain (cbit.vcell.math.CompartmentSubDomain)1 DataGenerator (cbit.vcell.math.DataGenerator)1 FilamentSubDomain (cbit.vcell.math.FilamentSubDomain)1 MathException (cbit.vcell.math.MathException)1 MembraneSubDomain (cbit.vcell.math.MembraneSubDomain)1 PointSubDomain (cbit.vcell.math.PointSubDomain)1 Domain (cbit.vcell.math.Variable.Domain)1 Expression (cbit.vcell.parser.Expression)1