Examples of Model


Examples of org.opensocial.models.Model

          }
          if (dataObject.containsKey("list")) {
            Object list = dataObject.get("list");
            if (list.getClass().equals(JSONArray.class)) {
              for (int i = 0; i < ((List) list).size(); i++) {
                Model object = (Model) ((List) list).get(i);
                response.getEntries().add(cloneModelObject(object,
                    modelClass));
              }
            } else if (list.getClass().equals(JSONObject.class)) {
              response.getEntries().add(cloneModelObject((Model) list,
View Full Code Here

Examples of org.owasp.dependencycheck.jaxb.pom.generated.Model

                    pomProperties = retrievePomProperties(path, jar);
                }
            } catch (IOException ex) {
                LOGGER.log(Level.FINEST, "ignore this, failed reading a non-existent pom.properties", ex);
            }
            Model pom = null;
            try {
                if (pomEntries.size() > 1) {
                    //extract POM to its own directory and add it as its own dependency
                    final Dependency newDependency = new Dependency();
                    pom = extractPom(path, jar, newDependency);
View Full Code Here

Examples of org.parosproxy.paros.model.Model

      try {
          file = chooser.getSelectedFile();
          if (file == null) {
            return;
          }
          Model cmpModel = new Model();
          Session session = cmpModel.getSession();

            //log.info("opening session file " + file.getAbsolutePath());
            //WaitMessageDialog waitMessageDialog = View.getSingleton().getWaitMessageDialog("Loading session file.  Please wait ...");
          session.open(file, this);
View Full Code Here

Examples of org.resmedicinae.resmedlib.region.Model

     * @exception NullPointerException if the operation is null
     * @exception NullPointerException if the controller is null
     */
    public Model ask(String o, GraphicalView d) throws Exception, NullPointerException {

        Model a = null;

        if (o != null) {

            java.lang.System.out.println("test o: " + o);

View Full Code Here

Examples of org.rsbot.client.Model

   *
   * @return The RSModel, or null if unavailable.
   */
  public RSModel getModel() {
    try {
      final Model model = obj.getModel();
      if (model != null && model.getXPoints() != null) {
        return new RSObjectModel(methods, model, obj);
      }
    } catch (final AbstractMethodError ignored) {
    }
    return null;
View Full Code Here

Examples of org.sbml.jsbml.Model

  public void processEndDocument(SBMLDocument sbmlDocument) {

    log4jLogger.debug("SBMLCoreParser: processEndDocument");
   
    if (sbmlDocument.isSetModel()) {
      Model model = sbmlDocument.getModel();

      if (model.isSetAreaUnits() && !model.isSetAreaUnitsInstance()) {
        log4jLogger.warn("No unitDefinition matches the areaUnitsID of Model.");
      }
      if (model.isSetConversionFactor()
          && !model.isSetConversionFactorInstance()) {
        log4jLogger.warn("No parameter matches the conversionFactorID of Model.");
      }
      if (model.isSetExtentUnits() && !model.isSetExtentUnitsInstance()) {
        log4jLogger.warn("No unitDefinition matches the extentUnitsID of Model.");
      }
      if (model.isSetLengthUnits() && !model.isSetLengthUnitsInstance()) {
        log4jLogger.warn("No unitDefinition matches the lengthUnitsID of Model.");
      }
      if (model.isSetSubstanceUnits()
          && !model.isSetSubstanceUnitsInstance()) {
        log4jLogger.warn("No unitDefinition matches the substanceUnitsID of Model.");
      }
      if (model.isSetTimeUnits() && !model.isSetTimeUnitsInstance()) {
        log4jLogger.warn("No unitDefinition matches the timeUnitsID of Model.");
      }
      if (model.isSetVolumeUnits() && !model.isSetVolumeUnitsInstance()) {
        log4jLogger.warn("No unitDefinition matches the volumeUnitsID of Model.");
      }

      if (model.isSetListOfRules()) {
       
        if (model.getLevel() == 1) {

          log4jLogger.debug("Transformed SBMLLevel1Rule: processEndDocument: model is level 1");

          int i = 0;
          for (Rule rule : model.getListOfRules().clone()) {
            if (rule instanceof SBMLLevel1Rule) {
              Rule realRule;
             
              if (((SBMLLevel1Rule) rule).isScalar()) {
                realRule = ((SBMLLevel1Rule) rule).cloneAsAssignmentRule();
                log4jLogger.debug("Transformed SBMLLevel1Rule: " + ((SBMLLevel1Rule) rule).getVariable() + " into AssignmentRule.");
              } else {
                realRule = ((SBMLLevel1Rule) rule).cloneAsRateRule();
                log4jLogger.debug("Transformed SBMLLevel1Rule: " + ((SBMLLevel1Rule) rule).getVariable() + " into RateRule.");
              }
             
              log4jLogger.debug("Transformed SBMLLevel1Rule: realRule = " + realRule);

              model.getListOfRules().remove(i);
              model.getListOfRules().add(i, realRule);
            }
            i++;
          }
        }
       
        for (int i = 0; i < model.getRuleCount(); i++) {
          Rule rule = model.getRule(i);
          if (rule instanceof AssignmentRule) {
            AssignmentRule assignmentRule = (AssignmentRule) rule;
            if (assignmentRule.isSetVariable()
                && !assignmentRule.isSetVariableInstance()) {
              log4jLogger.warn("No Symbol matches the variableID of AssignmentRule.");
            }
            if (assignmentRule.isSetUnits()
                && !assignmentRule.isSetUnitsInstance()
                && assignmentRule.isParameter()) {
              log4jLogger.warn("No UnitDefinition matches the unitsID of AssignmentRule.");
            }
          } else if (rule instanceof RateRule) {
            RateRule rateRule = (RateRule) rule;
            if (rateRule.isSetVariable()
                && !rateRule.isSetVariableInstance()) {
              log4jLogger.warn("No Symbol matches the variableID of RateRule.");
            }
          }
        }
      }
      if (model.isSetListOfCompartments()) {
        for (int i = 0; i < model.getCompartmentCount(); i++) {
          Compartment compartment = model.getCompartment(i);
          if (compartment.isSetCompartmentType()
              && !compartment.isSetCompartmentTypeInstance()) {
            log4jLogger.warn("No CompartmentType matches the compartmentTypeID of compartment.");
          }
          if (compartment.isSetOutside()
              && !compartment.isSetOutsideInstance()) {
            log4jLogger.warn("No Compartment matches the outsideID of compartment.");
          }
          if (compartment.isSetUnits()
              && !compartment.isSetUnitsInstance()) {
            log4jLogger.warn("No UnitDefinition matches the unitsID of compartment.");
          }
        }
      }
      if (model.isSetListOfEvents()) {
        for (int i = 0; i < model.getEventCount(); i++) {
          Event event = model.getEvent(i);

          if (event.isSetTimeUnits()
              && !event.isSetTimeUnitsInstance()) {
            log4jLogger.warn("No UnitDefinition matches the timeUnitsID of event.");
          }

          if (event.isSetListOfEventAssignments()) {

            for (int j = 0; j < event.getEventAssignmentCount(); j++) {
              EventAssignment eventAssignment = event
                  .getEventAssignment(j);

              if (eventAssignment.isSetVariable()
                  && !eventAssignment.isSetVariableInstance()) {
                log4jLogger.warn("No Symbol matches the variableID of eventAssignment.");
              }
            }
          }
        }
      }
      if (model.isSetListOfInitialAssignments()) {
        for (int i = 0; i < model.getInitialAssignmentCount(); i++) {
          InitialAssignment initialAssignment = model
              .getInitialAssignment(i);

          if (initialAssignment.isSetVariable()
              && !initialAssignment.isSetVariableInstance()) {
            log4jLogger.warn("No Symbol matches the symbolID of initialAssignment.");
          }
        }
      }
      if (model.isSetListOfReactions()) {
        for (int i = 0; i < model.getReactionCount(); i++) {
          Reaction reaction = model.getReaction(i);
          if (reaction.isSetCompartment()
              && !reaction.isSetCompartmentInstance()) {
            log4jLogger.warn("No Compartment matches the compartmentID of reaction.");
          }

          if (reaction.isSetListOfReactants()) {
            for (int j = 0; j < reaction.getReactantCount(); j++) {
              SpeciesReference speciesReference = reaction
                  .getReactant(j);

              if (speciesReference.isSetSpecies()
                  && !speciesReference.isSetSpeciesInstance()) {
                log4jLogger.warn(String.format("No Species matches the speciesID '%s' of %s.",
                    speciesReference.getId(), speciesReference.getElementName()));
              }
            }
          }
          if (reaction.isSetListOfProducts()) {
            for (int j = 0; j < reaction.getProductCount(); j++) {
              SpeciesReference speciesReference = reaction
                  .getProduct(j);

              if (speciesReference.isSetSpecies()
                  && !speciesReference.isSetSpeciesInstance()) {
                log4jLogger.warn(String.format("No Species matches the speciesID '%s' of %s.",
                    speciesReference.getId(), speciesReference.getElementName()));
              }
            }
          }
          if (reaction.isSetListOfModifiers()) {
            for (int j = 0; j < reaction.getModifierCount(); j++) {
              ModifierSpeciesReference modifierSpeciesReference = reaction
                  .getModifier(j);

              if (modifierSpeciesReference.isSetSpecies()
                  && !modifierSpeciesReference
                      .isSetSpeciesInstance()) {
                log4jLogger.warn(String.format("No Species matches the speciesID '%s' of %s.",
                    modifierSpeciesReference.getId(), modifierSpeciesReference.getElementName()));
              }
            }
          }
          if (reaction.isSetKineticLaw()) {
            KineticLaw kineticLaw = reaction.getKineticLaw();
            if (kineticLaw.isSetTimeUnits()
                && !kineticLaw.isSetTimeUnitsInstance()) {
              log4jLogger.warn("No UnitDefinition matches the timeUnitsID of kineticLaw.");
            }
            if (kineticLaw.isSetSubstanceUnits()
                && !kineticLaw.isSetSubstanceUnitsInstance()) {
              log4jLogger.warn("No UnitDefinition matches the substanceUnitsID of kineticLaw.");
            }
            if (kineticLaw.isSetListOfLocalParameters()) {
              for (int j = 0; j < kineticLaw.getLocalParameterCount(); j++) {
                LocalParameter parameter = kineticLaw
                    .getLocalParameter(j);
                if (parameter.isSetUnits()
                    && !parameter.isSetUnitsInstance()) {
                  log4jLogger.warn(String.format(
                    "No UnitDefinition matches the unitsID '%s'of the parameter %s.",
                    parameter.getUnits(), parameter.getId()));
                }
              }
            }
          }
        }
      }
      if (model.isSetListOfSpecies()) {
        for (int i = 0; i < model.getSpeciesCount(); i++) {
          Species species = model.getSpecies(i);

          if (species.isSetSubstanceUnits()
              && !species.isSetSubstanceUnitsInstance()) {
            log4jLogger.warn("No UnitDefinition matches the subtsanceUnitsID of species.");
          }
          if (species.isSetSpeciesType()
              && !species.isSetSpeciesTypeInstance()) {
            log4jLogger.warn("No SpeciesType matches the speciesTypeID of species.");
          }
          if (species.isSetConversionFactor()
              && !species.isSetConversionFactorInstance()) {
            log4jLogger.warn("No Parameter matches the conversionFactorID of species.");
          }
          if (species.isSetCompartment()
              && !species.isSetCompartmentInstance()) {
            log4jLogger.warn("No Compartment matches the compartmentID of species.");
          }
          if (species.isSetSpatialSizeUnits()
              && !species.isSetSpatialSizeUnitsInstance()) {
            log4jLogger.warn("No UnitDefinition matches the spatialSizeUnitsID of species.");
          }
        }
      }
      if (model.isSetListOfParameters()) {
        for (int i = 0; i < model.getParameterCount(); i++) {
          Parameter parameter = model.getParameter(i);
          if (parameter.isSetUnits()
              && !parameter.isSetUnitsInstance()) {
            log4jLogger.warn("No UnitDefinition matches the unitsID of parameter.");
          }
        }
View Full Code Here

Examples of org.sbml.libsbml.Model

       
        extractData(lines);
  //  System.out.println("Extracted data...");
        ModelBuilder mb = new ModelBuilder();
  //        Model model = mb.buildModel(name, compartment, unitlines, jwsunitlines, metaboliteUnit, rateUnit, reactions, species, parameter, metaboliteConcentrations, assrules, algrules, ratrules);
        Model model = mb.buildModel(name, compartment, unitlines, jwsunitlines, reactions, species, parameter, metaboliteConcentrations, assrules, algrules, funrules, ratrules);
  //      System.out.println("Built model...");

  // Check the consistency of the model
//   SBMLDocument doc = new SBMLDocument();
//   doc.setModel(model);
//   System.out.println("Checking consistency...");
//   long numErrorsWarnings = 0;
//   doc.setConsistencyChecks(libsbml.CATEGORY_MODELING_PRACTICE, false);
//   try {
//       numErrorsWarnings = doc.checkConsistency();
//   } catch(Exception e) {
//       System.out.println("Caught exception doing consistency check: " + e.getMessage());
//       e.printStackTrace();
//   }
//   long numErrors = 0;
//   System.out.println("Contains " + numErrorsWarnings + " errors or warnings");
//   boolean hasErrors = false;
//   if (numErrorsWarnings > 0) {
//       for (int i = 0; i < numErrorsWarnings; i++) {
//     SBMLError err = doc.getError(i);
//     if (err.getSeverity() > libsbml.SEVERITY_WARNING) {
//         hasErrors = true;
//         break;
//     }
//       }
//       if (hasErrors) {
//     try {
//         PrintWriter out = new PrintWriter(name + ".txt");
//         System.out.println("Found " + numErrorsWarnings + " errors or warnings for model " + name);
//         out.println("Found " + numErrorsWarnings + " errors for model " + name);
//         for (int i = 0; i < numErrorsWarnings; i++) {
//       SBMLError err = doc.getError(i);
//       if (err.getSeverity() > libsbml.SEVERITY_WARNING) {
//           out.println(err.getMessage());
//           numErrors++;
//       }
//         }
//         out.close();
//     }
//     catch (IOException e) {
//         System.out.println("Caught IOException: " + e.getMessage());
//     }
//       }
//   }
//   if (hasErrors) {
//       throw new Exception("Invalid SBML: " + numErrors + " errors");
//   }
  // Write the xml string
        String xmlmodel = new String(model.toSBML());
        if(xmlmodel != null && xmlmodel.length() > 0){
            String h = getHeader();
            xml = h + xmlmodel +
            "</sbml>";
        }
View Full Code Here

Examples of org.speakright.core.tests.Model

    m_run.registerPromptFile(path);
//    m_run.setReturnUrl("http://abc.com");
//    m_run.setGrammarBaseUrl(baseGramUrl);
//    m_run.setPromptBaseUrl(basePromptUrl);
    m_run.setExtensionFactory(this);
    M = new Model();
    m_run.setModelBinder(M, new ModelBinder(M));
    return m_run;
  }
View Full Code Here

Examples of org.spout.api.model.Model

  @Override
  public void onAttached() {
    super.onAttached();
    if (getOwner().getEngine() instanceof Client) {
      final SkydomeComponent skydome = getOwner().add(SkydomeComponent.class);
      final Model model = Spout.getFileSystem().getResource("model://Vanilla/materials/sky/skydome.spm");
      skydome.setModel(model);
      model.getRenderMaterial().addRenderEffect(VanillaEffects.SKY);
    }
    getOwner().setSkyLight(MAX_SKY_LIGHT);
  }
View Full Code Here

Examples of org.springframework.ui.Model

    assertThat(model.get(User), CoreMatchers.notNullValue());
  }

  @Test
  public void create_UsernameNotSpecified() {
    final Model model = createNiceMock(Model.class);
    final UserForm User = new UserForm();
    final BindingResult errors = createNiceMock(BindingResult.class);
    final String username = ""; //no username specified
    final String password = "password";
    final String confirmPassword = password;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.