Examples of Matching


Examples of Project1.Game.Modifiers.Matching

    // Show the face
    this.setIcon(Child.getImage());
    current = Child.getImage();
   
    // Determine the type of match
    Matching MatchType;
    if (Game.get().FlippedCard == null) {
      MatchType = Matching.Reveal;
    }
    else if (Game.get().FlippedCard != this) {
      if (Game.get().FlippedCard.getCard() == this.getCard()) {
View Full Code Here

Examples of de.timefinder.algo.graph.Matching

    public int[][] computeAssignments(float[][] costMatrixArg) {
        AssignmentArray matrix = new AssignmentArray();
        matrix.init(costMatrixArg);
        costMatrix = matrix.getCosts();
        Matching[] matching = new Matching[2];
        matching[0] = new Matching();
        matching[1] = new Matching();
        int i = 0;
        final int NO_X = costMatrix[0].length; // COLUMNS
        int NO_Y = costMatrix.length;    // ROWS

        float floatMax = AssignmentHelper.getFloatMax(Math.max(costMatrix.length, costMatrix[0].length));
View Full Code Here

Examples of de.timefinder.algo.graph.Matching

     */
    @Test
    public void testAddEdge() {
        System.out.println("addEdge");

        Matching instance = new Matching();
        instance.addEdge(3, 4, 5.6f);
        instance.addEdge(3, 4, 7f);
        instance.addEdge(0, 5, 5.6f);

        assertEquals(2, instance.getEdges().size());

        assertEquals(11.2f, instance.getTotalSum(), 0.01f);
    }
View Full Code Here

Examples of de.timefinder.algo.graph.Matching

     */
    @Test
    public void testToBipartiteArray() {
        System.out.println("toBipartiteArray");

        Matching instance = new Matching();
        instance.addEdge(0, 4 + 2, 5.6f);
        instance.addEdge(1, 4 + 3, 5.6f);
        instance.addEdge(3, 4 + 1, 5.6f);

        int[][] result = instance.toBipartiteArrayModY(4);
        assertEquals(2, result[0][0]);
        assertEquals(3, result[1][0]);
        assertEquals(null, result[2]);
        assertEquals(1, result[3][0]);
    }
View Full Code Here

Examples of org.terrier.matching.Matching

      if (rq.getControl("c_set").equals("true"))
      {
        wmodel.setParameter(Double.parseDouble(rq.getControl("c")));
      }
     
      Matching matching = getMatchingModel(rq);
     
      if (logger.isDebugEnabled()){
        logger.debug("weighting model: " + wmodel.getInfo());
      }
      MatchingQueryTerms mqt = rq.getMatchingQueryTerms();
      mqt.setDefaultTermWeightingModel((WeightingModel)wmodel);
      Query q = rq.getQuery();
     
      /* now propagate fields into requirements, and apply boolean matching
         for the decorated terms. */
      ArrayList<Query> requirement_list = new ArrayList<Query>();
      ArrayList<Query> field_list = new ArrayList<Query>();
     
      q.getTermsOf(RequirementQuery.class, requirement_list, true);
      q.getTermsOf(FieldQuery.class, field_list, true);
                     //  System.out.println(requirement_list);
                      //  System.out.println(field_list);
      for (int i=0; i<field_list.size(); i++)
        if (!requirement_list.contains(field_list.get(i)))
          requirement_list.add(field_list.get(i));
                                           
                       //     System.out.println(requirement_list);
                      //  System.out.println(field_list);
      /*if (logger.isDebugEnabled())
      {
        for (int i=0; i<requirement_list.size(); i++) {
          if(logger.isDebugEnabled()){
          logger.debug("requirement: " + ((RequiredTermModifier)requirement_list.get(i)).getName());
          }
        }
        for (int i=0; i<field_list.size(); i++) {
          if(logger.isDebugEnabled()){
          logger.debug("field: " + ((TermInFieldModifier)field_list.get(i)).getName());
          }
        }
      }*/
   
      if (requirement_list.size()>0) {
        mqt.addDocumentScoreModifier(new BooleanScoreModifier(requirement_list));
      }

      mqt.setQuery(q);
      mqt.normaliseTermWeights();
      try{
        ResultSet outRs = matching.match(rq.getQueryID(), mqt);
        //now crop the collectionresultset down to a query result set.
        rq.setResultSet(outRs.getResultSet(0, outRs.getResultSize()));
      } catch (IOException ioe) {
        logger.error("Problem running Matching, returning empty result set as query"+rq.getQueryID(), ioe);
        rq.setResultSet(new QueryResultSet(0));
View Full Code Here

Examples of org.terrier.matching.Matching

    * instance to use
    * @return null If an error occurred obtaining the matching class
    */
  protected Matching getMatchingModel(Request rq)
  {
    Matching rtr = null;
    Index _index = rq.getIndex();
    String ModelName = rq.getMatchingModel();
    //add the namespace if the modelname is not fully qualified
   
    final String ModelNames[] = ModelName.split("\\s*,\\s*");
 
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.