Search in sources :

Example 6 with EditableSymbolTableEntry

use of cbit.vcell.model.EditableSymbolTableEntry in project vcell by virtualcell.

the class BioModelParametersTableModel method getApplicationEditableSymbolTableEntryList.

private List<EditableSymbolTableEntry> getApplicationEditableSymbolTableEntryList(SimulationContext simulationContext) {
    ArrayList<EditableSymbolTableEntry> parameterList = new ArrayList<EditableSymbolTableEntry>();
    Map<String, SymbolTableEntry> entryMap = new HashMap<String, SymbolTableEntry>();
    simulationContext.getEntries(entryMap);
    for (SymbolTableEntry ste : entryMap.values()) {
        if (ste instanceof EditableSymbolTableEntry && ste.getNameScope() == simulationContext.getNameScope()) {
            parameterList.add((EditableSymbolTableEntry) ste);
        }
    }
    for (StructureMapping mapping : simulationContext.getGeometryContext().getStructureMappings()) {
        parameterList.addAll(mapping.computeApplicableParameterList());
    }
    for (SpeciesContextSpec spec : simulationContext.getReactionContext().getSpeciesContextSpecs()) {
        parameterList.addAll(spec.computeApplicableParameterList());
    }
    for (ElectricalStimulus elect : simulationContext.getElectricalStimuli()) {
        parameterList.addAll(Arrays.asList(elect.getParameters()));
    }
    for (SpatialProcess sp : simulationContext.getSpatialProcesses()) {
        parameterList.addAll(Arrays.asList(sp.getParameters()));
    }
    return parameterList;
}
Also used : ElectricalStimulus(cbit.vcell.mapping.ElectricalStimulus) SymbolTableEntry(cbit.vcell.parser.SymbolTableEntry) EditableSymbolTableEntry(cbit.vcell.model.EditableSymbolTableEntry) HashMap(java.util.HashMap) SpatialProcess(cbit.vcell.mapping.spatial.processes.SpatialProcess) ArrayList(java.util.ArrayList) SpeciesContextSpec(cbit.vcell.mapping.SpeciesContextSpec) StructureMapping(cbit.vcell.mapping.StructureMapping) EditableSymbolTableEntry(cbit.vcell.model.EditableSymbolTableEntry)

Example 7 with EditableSymbolTableEntry

use of cbit.vcell.model.EditableSymbolTableEntry in project vcell by virtualcell.

the class BioModelParametersTableModel method bioModelChange.

@Override
protected void bioModelChange(PropertyChangeEvent evt) {
    super.bioModelChange(evt);
    BioModel oldValue = (BioModel) evt.getOldValue();
    if (oldValue != null) {
        for (EditableSymbolTableEntry parameter : oldValue.getModel().getModelParameters()) {
            parameter.removePropertyChangeListener(this);
        }
        for (SpeciesContext sc : oldValue.getModel().getSpeciesContexts()) {
            sc.removePropertyChangeListener(this);
        }
        for (ReactionStep reactionStep : oldValue.getModel().getReactionSteps()) {
            reactionStep.removePropertyChangeListener(this);
            Kinetics kinetics = reactionStep.getKinetics();
            kinetics.removePropertyChangeListener(this);
            for (KineticsParameter kineticsEditableSymbolTableEntry : kinetics.getKineticsParameters()) {
                kineticsEditableSymbolTableEntry.removePropertyChangeListener(this);
            }
            for (ProxyParameter proxyEditableSymbolTableEntry : kinetics.getProxyParameters()) {
                proxyEditableSymbolTableEntry.removePropertyChangeListener(this);
            }
            for (UnresolvedParameter unresolvedEditableSymbolTableEntry : kinetics.getUnresolvedParameters()) {
                unresolvedEditableSymbolTableEntry.removePropertyChangeListener(this);
            }
        }
        for (SimulationContext simulationContext : oldValue.getSimulationContexts()) {
            simulationContext.removePropertyChangeListener(this);
            simulationContext.getGeometryContext().removePropertyChangeListener(this);
            for (StructureMapping mapping : simulationContext.getGeometryContext().getStructureMappings()) {
                mapping.removePropertyChangeListener(this);
                for (EditableSymbolTableEntry parameter : mapping.getParameters()) {
                    parameter.removePropertyChangeListener(this);
                }
            }
            simulationContext.getReactionContext().removePropertyChangeListener(this);
            for (SpeciesContextSpec spec : simulationContext.getReactionContext().getSpeciesContextSpecs()) {
                spec.removePropertyChangeListener(this);
                for (EditableSymbolTableEntry parameter : spec.getParameters()) {
                    parameter.removePropertyChangeListener(this);
                }
            }
            for (ElectricalStimulus elect : simulationContext.getElectricalStimuli()) {
                elect.removePropertyChangeListener(this);
                for (EditableSymbolTableEntry parameter : elect.getParameters()) {
                    parameter.removePropertyChangeListener(this);
                }
            }
            for (SpatialObject spatialObject : simulationContext.getSpatialObjects()) {
                spatialObject.removePropertyChangeListener(this);
            }
            for (SpatialProcess spatialProcess : simulationContext.getSpatialProcesses()) {
                spatialProcess.removePropertyChangeListener(this);
                for (LocalParameter p : spatialProcess.getParameters()) {
                    p.removePropertyChangeListener(this);
                }
            }
            for (SimulationContextParameter p : simulationContext.getSimulationContextParameters()) {
                p.removePropertyChangeListener(this);
            }
        }
    }
    BioModel newValue = (BioModel) evt.getNewValue();
    if (newValue != null) {
        for (ModelParameter modelEditableSymbolTableEntry : newValue.getModel().getModelParameters()) {
            modelEditableSymbolTableEntry.addPropertyChangeListener(this);
        }
        for (SpeciesContext sc : newValue.getModel().getSpeciesContexts()) {
            sc.addPropertyChangeListener(this);
        }
        for (ReactionStep reactionStep : newValue.getModel().getReactionSteps()) {
            reactionStep.addPropertyChangeListener(this);
            Kinetics kinetics = reactionStep.getKinetics();
            kinetics.addPropertyChangeListener(this);
            for (KineticsParameter kineticsEditableSymbolTableEntry : kinetics.getKineticsParameters()) {
                kineticsEditableSymbolTableEntry.addPropertyChangeListener(this);
            }
            for (ProxyParameter proxyEditableSymbolTableEntry : kinetics.getProxyParameters()) {
                proxyEditableSymbolTableEntry.addPropertyChangeListener(this);
            }
            for (UnresolvedParameter unresolvedEditableSymbolTableEntry : kinetics.getUnresolvedParameters()) {
                unresolvedEditableSymbolTableEntry.addPropertyChangeListener(this);
            }
        }
        for (SimulationContext simulationContext : newValue.getSimulationContexts()) {
            simulationContext.addPropertyChangeListener(this);
            simulationContext.getGeometryContext().addPropertyChangeListener(this);
            for (StructureMapping mapping : simulationContext.getGeometryContext().getStructureMappings()) {
                mapping.addPropertyChangeListener(this);
                for (EditableSymbolTableEntry parameter : mapping.getParameters()) {
                    parameter.addPropertyChangeListener(this);
                }
            }
            simulationContext.getReactionContext().addPropertyChangeListener(this);
            for (SpeciesContextSpec spec : simulationContext.getReactionContext().getSpeciesContextSpecs()) {
                spec.addPropertyChangeListener(this);
                for (EditableSymbolTableEntry parameter : spec.getParameters()) {
                    parameter.addPropertyChangeListener(this);
                }
            }
            for (ElectricalStimulus elect : simulationContext.getElectricalStimuli()) {
                elect.addPropertyChangeListener(this);
                for (EditableSymbolTableEntry parameter : elect.getParameters()) {
                    parameter.addPropertyChangeListener(this);
                }
            }
            for (SpatialObject spatialObject : simulationContext.getSpatialObjects()) {
                spatialObject.addPropertyChangeListener(this);
            }
            for (SpatialProcess spatialProcess : simulationContext.getSpatialProcesses()) {
                spatialProcess.addPropertyChangeListener(this);
                for (LocalParameter p : spatialProcess.getParameters()) {
                    p.addPropertyChangeListener(this);
                }
            }
            for (SimulationContextParameter p : simulationContext.getSimulationContextParameters()) {
                p.addPropertyChangeListener(this);
            }
        }
    }
}
Also used : UnresolvedParameter(cbit.vcell.model.Kinetics.UnresolvedParameter) SpeciesContext(cbit.vcell.model.SpeciesContext) SimulationContext(cbit.vcell.mapping.SimulationContext) SpeciesContextSpec(cbit.vcell.mapping.SpeciesContextSpec) SimulationContextParameter(cbit.vcell.mapping.SimulationContext.SimulationContextParameter) StructureMapping(cbit.vcell.mapping.StructureMapping) SpatialObject(cbit.vcell.mapping.spatial.SpatialObject) LocalParameter(cbit.vcell.mapping.ParameterContext.LocalParameter) ElectricalStimulus(cbit.vcell.mapping.ElectricalStimulus) ModelParameter(cbit.vcell.model.Model.ModelParameter) ProxyParameter(cbit.vcell.model.ProxyParameter) KineticsParameter(cbit.vcell.model.Kinetics.KineticsParameter) SpatialProcess(cbit.vcell.mapping.spatial.processes.SpatialProcess) BioModel(cbit.vcell.biomodel.BioModel) ReactionStep(cbit.vcell.model.ReactionStep) Kinetics(cbit.vcell.model.Kinetics) EditableSymbolTableEntry(cbit.vcell.model.EditableSymbolTableEntry)

Aggregations

EditableSymbolTableEntry (cbit.vcell.model.EditableSymbolTableEntry)7 SimulationContext (cbit.vcell.mapping.SimulationContext)4 SimulationContextParameter (cbit.vcell.mapping.SimulationContext.SimulationContextParameter)4 SpeciesContextSpec (cbit.vcell.mapping.SpeciesContextSpec)4 ModelParameter (cbit.vcell.model.Model.ModelParameter)4 ArrayList (java.util.ArrayList)4 ElectricalStimulus (cbit.vcell.mapping.ElectricalStimulus)3 StructureMapping (cbit.vcell.mapping.StructureMapping)3 SpatialProcess (cbit.vcell.mapping.spatial.processes.SpatialProcess)3 Kinetics (cbit.vcell.model.Kinetics)3 KineticsParameter (cbit.vcell.model.Kinetics.KineticsParameter)3 ReactionStep (cbit.vcell.model.ReactionStep)3 LocalParameter (cbit.vcell.mapping.ParameterContext.LocalParameter)2 SpatialObject (cbit.vcell.mapping.spatial.SpatialObject)2 UnresolvedParameter (cbit.vcell.model.Kinetics.UnresolvedParameter)2 ProxyParameter (cbit.vcell.model.ProxyParameter)2 ReactionRule (cbit.vcell.model.ReactionRule)2 SpeciesContext (cbit.vcell.model.SpeciesContext)2 SymbolTableEntry (cbit.vcell.parser.SymbolTableEntry)2 HashMap (java.util.HashMap)2