本文整理汇总了Java中org.sbml.jsbml.Compartment.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Compartment.getId方法的具体用法?Java Compartment.getId怎么用?Java Compartment.getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sbml.jsbml.Compartment
的用法示例。
在下文中一共展示了Compartment.getId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CompartmentAliasWrapper
import org.sbml.jsbml.Compartment; //导入方法依赖的package包/类
/**
* Instantiates a new compartment alias wrapper.
*
* @param cg
* the cg
* @param modelWrapper
* the model wrapper
*/
public CompartmentAliasWrapper(CompartmentGlyph cg, ModelWrapper modelWrapper) {
this.compartmentAlias = new CompartmentAlias();
modelWrapper.addCompartmentAlias(compartmentAlias);
compartmentAliased = (Compartment) cg.getCompartmentInstance();
this.id = compartmentAliased.getId() + "alias";
compartmentAlias.setId(id);
this.compartment = compartmentAliased.getId();
compartmentAlias.setCompartment(compartmentAliased.getId());
bounds = new Bounds();
setH(cg.getBoundingBox().getDimensions().getHeight());
setW(cg.getBoundingBox().getDimensions().getWidth());
setX(cg.getBoundingBox().getPosition().getX());
setY(cg.getBoundingBox().getPosition().getY());
compartmentAlias.setBounds(bounds);
this.clazz = "SQUARE";
compartmentAlias.setClazz(clazz);
doubleLine = new DoubleLine();
doubleLine.setInnerWidth(new BigDecimal(DEFAULT_COMPARTMENT_INNER_WIDTH));
doubleLine.setOuterWidth(new BigDecimal(DEFAULT_COMPARTMENT_OUTER_WIDTH));
doubleLine.setThickness(new BigDecimal(DEFAULT_COMPARTMENT_WIDTH));
compartmentAlias.setDoubleLine(doubleLine);
info = new Info();
info.setAngle(new BigDecimal(0d));
info.setState("empty");
compartmentAlias.setInfo(info);
namePoint = new Point();
compartmentAlias.setNamePoint(namePoint);
paint = new Paint();
paint.setColor("ffcccc00");
paint.setScheme("Color");
compartmentAlias.setPaint(paint);
point = new Point();
compartmentAlias.setPoint(new Point());
}
示例2: refreshCompartmentPanel
import org.sbml.jsbml.Compartment; //导入方法依赖的package包/类
/**
* Refresh compartment panel
*/
public void refreshCompartmentPanel(BioModel gcm) {
String selectedCompartment = "";
if (!compartments.isSelectionEmpty()) {
selectedCompartment = ((String) compartments.getSelectedValue()).split("\\[| ")[0];
}
this.bioModel = gcm;
Model model = gcm.getSBMLDocument().getModel();
ListOf<Compartment> listOfCompartments = model.getListOfCompartments();
String[] comparts = new String[model.getCompartmentCount()];
for (int i = 0; i < model.getCompartmentCount(); i++) {
Compartment compartment = listOfCompartments.get(i);
comparts[i] = compartment.getId() + SBMLutilities.getDimensionString(compartment);
comparts[i] += " " + compartment.getSize();
if (paramsOnly) {
for (int j = 0; j < parameterChanges.size(); j++) {
String[] splits = parameterChanges.get(j).split(" ");
if (splits[0].equals(comparts[i].split(" ")[0])) {
parameterChanges.set(j, comparts[i] + " " + splits[splits.length-2] + " " +
splits[splits.length-1]);
comparts[i] = parameterChanges.get(j);
}
}
}
}
edu.utah.ece.async.ibiosim.dataModels.biomodel.util.Utility.sort(comparts);
int selected = 0;
for (int i = 0; i < comparts.length; i++) {
if (comparts[i].split("\\[| ")[0].equals(selectedCompartment)) {
selected = i;
}
}
compartments.setListData(comparts);
compartments.setSelectedIndex(selected);
}
示例3: setupCompartments
import org.sbml.jsbml.Compartment; //导入方法依赖的package包/类
private static void setupCompartments(HierarchicalSimulation sim, ModelContainer container, VectorWrapper wrapper)
{
Model model = container.getModel();
HierarchicalModel modelstate = container.getHierarchicalModel();
VariableNode node;
for (Compartment compartment : model.getListOfCompartments())
{
ReplacementSetup.setupReplacement(sim, compartment, wrapper,VariableType.VARIABLE, container);
String printVariable = container.getPrefix() + compartment.getId();
String compartmentID = compartment.getId();
node = modelstate.getNode(compartmentID);
if(node == null)
{
node = new VariableNode(compartmentID);
modelstate.addMappingNode(compartmentID, node);
}
if(sim.getInterestingSpecies() != null && sim.getInterestingSpecies().contains(printVariable))
{
sim.addPrintVariable(printVariable, node, modelstate.getIndex(), false);
}
if (modelstate.isDeletedBySId(compartmentID))
{
continue;
}
if (compartment.getConstant())
{
node.createState(StateType.SCALAR, wrapper);
}
else
{
int index = modelstate.getIndex();
node.createState(sim.getAtomicType(), wrapper);
modelstate.addVariable(node);
node.getState().addState(index, 0);
if(sim.getInterestingSpecies() == null)
{
sim.addPrintVariable(printVariable, node, modelstate.getIndex(), false);
}
}
if (Double.isNaN(compartment.getSize()))
{
node.setValue(modelstate.getIndex(), 1);
}
else
{
node.setValue(modelstate.getIndex(), compartment.getSize());
node.setIsSetInitialValue(true);
}
}
}
示例4: setupParameters
import org.sbml.jsbml.Compartment; //导入方法依赖的package包/类
/**
* puts parameter-related information into data structures
*/
protected void setupParameters()
{
// add local parameters
for (Reaction reaction : model.getListOfReactions())
{
if (!reaction.isSetKineticLaw())
{
continue;
}
KineticLaw kineticLaw = reaction.getKineticLaw();
setupLocalParameters(kineticLaw, reaction);
}
// add values to hashmap for easy access to global parameter values
// NOTE: the IDs for the parameters and species must be unique, so
// putting them in the
// same hashmap is okay
for (Parameter parameter : model.getListOfParameters())
{
setupSingleParameter(parameter);
}
// add compartment sizes in
for (Compartment compartment : model.getListOfCompartments())
{
String compartmentID = compartment.getId();
compartmentIDSet.add(compartmentID);
variableToValueMap.put(compartmentID, compartment.getSize());
if (Double.isNaN(compartment.getSize()))
{
variableToValueMap.put(compartmentID, 1.0);
}
variableToIsConstantMap.put(compartmentID, compartment.getConstant());
if (numRules > 0)
{
variableToIsInAssignmentRuleMap.put(compartmentID, false);
}
if (numConstraints > 0)
{
variableToIsInConstraintMap.put(compartmentID, false);
}
}
}