Examples of Model


Examples of net.sf.cpsolver.ifs.model.Model

    /** Initialization */
    public void init(Solver solver) {}
   
    /** Variable selection */
    public Variable selectVariable(Solution solution) {
        Model model = solution.getModel();
        if (model.nrUnassignedVariables()==0) return null;
        Variable variable = null;
        for (Enumeration e=model.unassignedVariables().elements();e.hasMoreElements();) {
            Variable v = (Variable)e.nextElement();
            if (variable==null || v.compareTo(variable)<0) variable = v;
        }
        return variable;
    }
View Full Code Here

Examples of net.sf.jiga.xtended.impl.game.Model

        if (data instanceof List) {
            files = ((List<File>) data);
        }
        if (files instanceof List) {
            for (File f : files) {
                final Model m = Model._importModel(f.getAbsolutePath());
                if (m instanceof Model) {
                    imodel2 = m;
                    break;
                } else {
                    continue;
View Full Code Here

Examples of net.sf.jmd.metarepresentation.impl.Model

        if (amFiles == null) {
            throw new MoDiException("We have no model files, call "
                    + "findArchitectsModelFiles(...) first.");
        }

        IModel amModel = new Model();
        amModel.setType(Model.Type.AM);
        amModel = transformModel(amFiles, language);
        metaRepresentation.setAmModel(amModel);
    }
View Full Code Here

Examples of net.sf.minuteProject.configuration.bean.Model

        new DatabaseIO().write(database, filename);
  }
 
  private String getFileSourceName(DataModel dataModel) {
    FileSource fileSource = dataModel.getFileSource();
    Model model = dataModel.getModel();
      String filename = null;
      String filedir = null;
      String version = dataModel.getModel().getVersion();
      String defaultName = model.getName();
      if (version==null)
        defaultName = defaultName+"-"+version;
      if (fileSource!=null) {
        filename = fileSource.getName();
        filedir = fileSource.getDir();
View Full Code Here

Examples of net.sourceforge.barcodegen.model.Model

    loadTable(conditions);
  }

  public void loadTable(String conditions){

    Model strip = new Model("Strip");
    tableModel.rowsClear();
    table.revalidate();
    showProgress("Consultando...");
    table.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
   
    try{
      conditions = conditions.trim().length() > 0 ? conditions : "id=id";
      ResultSet rs = strip.find(conditions + " order by fecha desc");
      int recordCount = 0;

      while (rs.next()){
       
        ResultSet list = Main.lista.find("id=" + rs.getString("lista_id"));
View Full Code Here

Examples of net.sourceforge.pebble.web.model.Model

  public void testViewMonth() throws Exception {
    request.setParameter("year", "2006");
    request.setParameter("month", "05");
    View view = action.process(request, response);

    Model model = action.getModel();
    assertEquals(blog.getBlogForMonth(2006, 5), model.get(Constants.MONTHLY_BLOG));
    assertNotNull(model.get(Constants.BLOG_ENTRIES));
    assertTrue(view instanceof BlogEntriesByMonthView);
  }
View Full Code Here

Examples of nexus.main.Model

  public static final int TEST_ITERATIONS = 2; // default is 5, but this can be annoying for dev
  public static Model world;
 
  @BeforeClass
  public static void testSetup() {
    world = new Model(new Camera(new Vector3(0f, 0f, 0f), 0f, 0f, 0f, false));
  }
View Full Code Here

Examples of nz.ac.waikato.modeljunit.Model

            m_tester[0].addListener(vl);
        }
        // We always want to see the tests drawn
        m_tester[0].addListener(new VisualisationListener());
        // Redirect model's output to string
        Model md = m_tester[0].getModel();
        Writer defWriter = md.getOutput();
        md.setOutput(sw);
        // This writer updates the test results panel.
        // TODO: move this class into PanelResultViewer.
        Writer newWriter = new Writer() {
            @Override
            public void close() throws IOException {
            }

            @Override
            public void flush() throws IOException {
            }

            @Override
            public void write(char[] cbuf, int off, int len) throws IOException {
                StringBuffer str = new StringBuffer();
                for (int i = off; i < off + len; i++) {
                    str.append(cbuf[i]);
                }
                gui.getResultViewer().updateRunTimeInformation(str.toString());
            }
        };
        md.setOutput(newWriter);

        for (int i = 0; i < COVERAGE_NUM; i++) {
            if (bCoverage[i])
                coverage[i].clear();
        }

        if (m_tester[0] instanceof QuickTester) {
            QuickTester tester = (QuickTester) m_tester[0];
            tester.clear();
        }

        // Generate tests
        //System.err.println("Generating " + project.getWalkLength() + " tests with " + m_tester[0]);
        m_tester[0].generate(project.getWalkLength());

        // Print out generated model coverage metrics
        for (int metric = 0; metric < COVERAGE_NUM; metric++) {
            if (bCoverage[metric]) {
                try {
                    newWriter.write(TestExeModel.COVERAGE_MATRIX[metric] + " = " + coverage[metric].toString() + "\n");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }
        // Reset model's output to default value
        md.setOutput(defWriter);

        // Recover System.out
        output = baos.toString();
        System.out.println(output);
        // Restore system.out to default value.
View Full Code Here

Examples of oop13.space.model.Model

    }
  }
 
  @Test
  public void testAddIndividuals() {
    IModel model = new Model();
    model.initIndividuals();
    for (int i = 0; i < 10; i++) {
      ShipShot shot = model.addShot();
      Assert.assertTrue(model.getList().contains(shot));
    }
    Assert.assertEquals(model.getList().size(), 75);
    AlienMotherShip motherShip = model.addMotherShip();
    Assert.assertEquals(model.getList().size(), 76);
    for (int i = 0; i < 5; i++) {
      AlienShot alienShot = model.addAlienShot(new AlienShot(10, i));
      Assert.assertTrue(model.getList().contains(alienShot));
    }
    Assert.assertEquals(model.getList().size(), 81);
    Assert.assertTrue(model.getList().contains(motherShip));
  }
View Full Code Here

Examples of org.activiti.engine.repository.Model

    @Path("open")
    @Produces(MediaType.APPLICATION_JSON)
    public Object open(@QueryParam("id") String modelId) throws Exception {
        RepositoryService repositoryService = processEngine
                .getRepositoryService();
        Model model = repositoryService.getModel(modelId);

        if (model == null) {
            logger.info("model({}) is null", modelId);
            model = repositoryService.newModel();
            repositoryService.saveModel(model);
        }

        Map root = new HashMap();
        root.put("modelId", model.getId());
        root.put("name", "name");
        root.put("revision", 1);
        root.put("description", "description");

        byte[] bytes = repositoryService.getModelEditorSource(model.getId());

        if (bytes != null) {
            String modelEditorSource = new String(bytes, "utf-8");
            logger.info("modelEditorSource : {}", modelEditorSource);

            Map modelNode = jsonMapper.fromJson(modelEditorSource, Map.class);
            root.put("model", modelNode);
        } else {
            Map modelNode = new HashMap();
            modelNode.put("id", "canvas");
            modelNode.put("resourceId", "canvas");

            Map stencilSetNode = new HashMap();
            stencilSetNode.put("namespace",
                    "http://b3mn.org/stencilset/bpmn2.0#");
            modelNode.put("stencilset", stencilSetNode);

            model.setMetaInfo(jsonMapper.toJson(root));
            model.setName("name");
            model.setKey("key");

            root.put("model", modelNode);
        }

        logger.info("model : {}", root);
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.