Examples of Assignment


Examples of de.timefinder.data.algo.Assignment

        ncpInstance.correctOrderWithBubbleSort(canister);
        check(canister);
    }

    private void check(List<Assignment> list) {
        Assignment subj;
        for (int i = 0; i < list.size(); i++) {
            subj = list.get(i);

            //only check followers
            for (Event f : subj.getEvent().getConstraint(EventOrderConstraint.class).getFollows()) {
                assertTrue("i:" + i + " \tcurrent:" + subj + " \tfollower:" + f
                        + " \tlist:" + list, indexOfEvent(list, f) > i);
            }
        }
    }
View Full Code Here

Examples of de.timefinder.data.algo.Assignment

        oc2.addBefore(prev.getEvent());
    }

    @Override
    protected Assignment newAssignment(String str) {
        Assignment ass = super.newAssignment(str, 1, 1);
        ass.getEvent().putConstraint(new EventOrderConstraint(ass.getEvent()));
        return ass;
    }
View Full Code Here

Examples of de.timefinder.data.algo.Assignment

        super.setUp();
    }

    @Test
    public void testGetStart() {
        assertEquals(-1, new Assignment(new Event(1, 2)).getStart());
        Assignment ass = newAssignment("test", 1, 2);
        assertEquals(1, ass.getStart());
        assertEquals(2, ass.getEvent().getDuration());
        assertEquals("test", ass.getEvent().getName());
    }
View Full Code Here

Examples of de.timefinder.data.algo.Assignment

        assertEquals("test", ass.getEvent().getName());
    }

    @Test
    public void testToString() {
        Assignment ass = newAssignment("test", 1, 2);
        assertNotNull(ass.toString());
    }
View Full Code Here

Examples of dk.brics.xact.analysis.flowgraph.statements.Assignment

    // copy propagation
    for (Statement s : new LinkedHashSet<Statement>(graph.getNodes())) {
      if (s instanceof VarStm) {
        VarStm vs = (VarStm)s;
        if (graph.getInEdges(vs).size() == 1) {
          Assignment pred = (Assignment)(graph.getInEdges(vs).iterator().next()).getFrom();
          if (graph.getOutEdges(pred).size()==1) {
            // variable assignment with unique predecessor node that has no other successors - bypass this assignment
            pred.setDest(vs.getDest());
            for (Edge<Statement,VariableFilter> e : graph.getOutEdges(vs))
              graph.addEdge(pred, e.getTo(), e.getData()); // XXX: ok to lose some edge info?
            graph.removeNode(vs);
          }
        } else if (graph.getOutEdges(vs).size() == 1) {
View Full Code Here

Examples of edu.ucla.sspace.clustering.Assignment

                : clustering.cluster(matrix, props);
        }

        int a = 0;
        for (String word : words) {
            Assignment assignment = assignments.get(a++);
            System.out.printf("%s ", word);
            for (int i : assignment.assignments())
                System.out.printf("%d ", i);
            System.out.println();
        }
    }
View Full Code Here

Examples of gui.performer_main.Assignment

   * If any of the tests have failed, set the result as FAILED.
   * The result is used for visually marking the assignment in the gui student list panel.
   */
  private void testAssignment() {
    String result = "";
    Assignment assignment = new Assignment(file);
    for (TestFile tFile : testList) {
      Tester test = new Tester(file, tFile.getInput());
      if (tFile.getOutputTest()) {
        test.doOutput_test(tFile.getOutputTest(), tFile.getOutput());
      }
      if (tFile.getTimeTest()) {
        test.doElapsed_time_test(tFile.getTimeTest());
      }
      if (tFile.getCPUTimeTest()) {
        test.doCpu_time_test(tFile.getCPUTimeTest());
      }
      if (tFile.getMemoryTest()) {
        test.doMemory_test(tFile.getMemoryTest());
      }
      if (tFile.getThreadNumberTest()) {
        test.doThd_test(tFile.getThreadNumberTest());
      }
      if (tFile.gethandlersTest()) {
        test.doHnd_test(tFile.gethandlersTest());
      }
      if (tFile.getProcessIDTest()) {
        test.doPid_test(tFile.getProcessIDTest());
      }
      test.setTime_limit(tFile.getTimeLimit());
      test.start();
      if (test.getOutput().equalsIgnoreCase("false") || test.getHas_error().equalsIgnoreCase("false")) result = "PASS";
      else result = "FAILED";
    }
    assignment.setResult(result);
  }
View Full Code Here

Examples of io.crate.sql.tree.Assignment

                .add("name", DataTypes.STRING, null, true)
                .addPrimaryKey("name").build();

        PartitionName partitionName = PartitionPropertiesAnalyzer.toPartitionName(
                tableInfo,
                Arrays.asList(new Assignment(
                        new QualifiedNameReference(new QualifiedName("name")),
                        new StringLiteral("foo"))),
                new Object[0]);
        assertThat(partitionName.stringValue(), is(".partitioned.users.0426crrf"));
    }
View Full Code Here

Examples of loop.ast.Assignment

      // If this is an assignment, just check the rhs portion of it.
      // This is a bit hacky but prevents verification from balking about new
      // vars declared in the lhs.
      if (parsedLine instanceof Assignment) {
        new Reducer(parsedLine).reduce();
        Assignment assignment = (Assignment) parsedLine;

        // Strip the lhs of the assignment if this is a simple variable setter
        // as that will happen after the fact in a where-block.
        // However we still do have Assignment nodes that assign "in-place", i.e.
        // mutate the state of existing variables (example: a.b = c), and these need
        // to continue untouched.
        if (assignment.lhs() instanceof Variable)
          func.children().add(assignment.rhs());
        else
          func.children().add(parsedLine);
      } else
        func.children().add(parsedLine);

      // Compress nodes and eliminate redundancies.
      new Reducer(func).reduce();

      shellScope.loadDeps("<shell>");
      executable.runMain(true);
      executable.compileExpression(shellScope);

      if (executable.hasErrors()) {
        executable.printStaticErrorsIfNecessary();

        return "";
      }
    } catch (Exception e) {
      e.printStackTrace();
      return new LoopError("malformed expression " + rawLine);
    }

    try {
      Object result = Loop.safeEval(executable, null);

      if (addToWhereBlock && parsedLine instanceof Assignment) {
        Assignment assignment = (Assignment) parsedLine;

        boolean shouldReplace = false, shouldAddToWhere = true;
        if (assignment.lhs() instanceof Variable) {
          String name = ((Variable) assignment.lhs()).name;
          shellContext.put(name, result);

          // Look up the value of the RHS of the variable from the shell context,
          // if this is the second reference to the same variable.
          assignment.setRhs(new LexprParser(new Tokenizer(
              "`loop.LoopShell`.shellObtain('" + name + "')").tokenize()).parse());
          shouldReplace = true;
        } else
          shouldAddToWhere = false;   // Do not add state-mutating assignments to where block.
View Full Code Here

Examples of name.abuchen.portfolio.model.Classification.Assignment

        }
        else if (change > 0)
        {
            // create a new node, but only if change is positive

            Assignment assignment = new Assignment(investmentVehicle);
            assignment.setWeight(change);
            getModel().getUnassignedNode().addChild(assignment);
            getModel().setWeightByInvestmentVehicle(investmentVehicle, totalWeight + change);
        }

        // do not fire model change -> called within modification listener
View Full Code Here
TOP
Copyright © 2015 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.