Examples of addConstraint()


Examples of aima.core.search.csp.CSP.addConstraint()

  }

  @Test
  public void testConstraintNetwork() {
    CSP csp = new CSP(variables);
    csp.addConstraint(C1);
    csp.addConstraint(C2);
    Assert.assertNotNull(csp.getConstraints());
    Assert.assertEquals(2, csp.getConstraints().size());
    Assert.assertNotNull(csp.getConstraints(X));
    Assert.assertEquals(2, csp.getConstraints(X).size());
View Full Code Here

Examples of bitbucket.issues.url.FilteredSearchURL.SearchConstraint.addConstraint()

   * Create a search for issues from project X which milestone begins with
   * "production" and the title contains "button"
   */
  static void test2() {
    SearchConstraint constraint = new SearchConstraint();
    constraint.addConstraint(Parameter.MILESTONE, Operator.BEGINS_WITH, "production");
    constraint.addConstraint(Parameter.TITLE, Operator.CONTAINS, "button");
   
    IssueURL advancedSearch = IssueURLFactory.fetch(username, slug, constraint);
   
    /* the rest is copy&paste from above */
 
View Full Code Here

Examples of cc.mallet.classify.constraints.ge.MaxEntKLFLGEConstraints.addConstraint()

      }
      else {
        MaxEntKLFLGEConstraints geConstraints = new MaxEntKLFLGEConstraints(train.getDataAlphabet().size(),
            train.getTargetAlphabet().size(),useValues);
        for (int fi : constraintsMap.keySet()) {
          geConstraints.addConstraint(fi, constraintsMap.get(fi), 1);
        }
        constraints = new ArrayList<MaxEntGEConstraint>();
        constraints.add(geConstraints);
      }
    }
View Full Code Here

Examples of cc.mallet.classify.constraints.ge.MaxEntL2FLGEConstraints.addConstraint()

      constraints = new ArrayList<MaxEntGEConstraint>();
      if (l2) {
        MaxEntL2FLGEConstraints geConstraints = new MaxEntL2FLGEConstraints(train.getDataAlphabet().size(),
            train.getTargetAlphabet().size(),useValues,normalize);
        for (int fi : constraintsMap.keySet()) {
          geConstraints.addConstraint(fi, constraintsMap.get(fi), 1);
        }
        constraints.add(geConstraints);
      }
      else {
        MaxEntKLFLGEConstraints geConstraints = new MaxEntKLFLGEConstraints(train.getDataAlphabet().size(),
View Full Code Here

Examples of cc.mallet.classify.constraints.ge.MaxEntRangeL2FLGEConstraints.addConstraint()

        train.getTargetAlphabet().size(),useValues,normalize);
      for (int fi : constraintsMap.keySet()) {
        double[][] dist = constraintsMap.get(fi);
        for (int li = 0; li < dist.length; li++) {
          if (!Double.isInfinite(dist[li][0])) {
            geConstraints.addConstraint(fi, li, dist[li][0], dist[li][1], 1);
          }
        }
      }
      constraints.add(geConstraints);
    }
View Full Code Here

Examples of cc.mallet.classify.constraints.pr.MaxEntL2FLPRConstraints.addConstraint()

      logger.info("number of constraints: " + constraintsMap.size());
      constraints = new ArrayList<MaxEntPRConstraint>();
      MaxEntL2FLPRConstraints prConstraints = new MaxEntL2FLPRConstraints(data.getDataAlphabet().size(),
          data.getTargetAlphabet().size(),useValues,normalize);
      for (int fi : constraintsMap.keySet()) {
        prConstraints.addConstraint(fi, constraintsMap.get(fi), qGPV);
      }
      constraints.add(prConstraints);
    }

    BitSet instancesWithConstraints = new BitSet(data.size());
View Full Code Here

Examples of cc.mallet.fst.semi_supervised.constraints.OneLabelKLGEConstraints.addConstraint()

            }
            if (!Maths.almostEquals(sum, 1)) {
              throw new RuntimeException("Targets must sum to 1 when using a KL divergence penalty!");
            }
           
            geConstraints.addConstraint(fi, prob, 1);
          }
          constraintsList.add(geConstraints);
        }
        else if (penaltyOption.value.equalsIgnoreCase("l2")) {
          OneLabelL2RangeGEConstraints geConstraints = new OneLabelL2RangeGEConstraints();
View Full Code Here

Examples of cc.mallet.fst.semi_supervised.constraints.OneLabelL2RangeGEConstraints.addConstraint()

          OneLabelL2RangeGEConstraints geConstraints = new OneLabelL2RangeGEConstraints();
          for (int fi : constraints.keySet()) {
            double[][] dist = constraints.get(fi);
            for (int li = 0; li < dist.length; li++) {
              if (!Double.isInfinite(dist[li][0])) {
                geConstraints.addConstraint(fi, li, dist[li][0], dist[li][1], 1);
              }
            }
          }
          constraintsList.add(geConstraints);
        }
View Full Code Here

Examples of cc.mallet.fst.semi_supervised.pr.constraints.OneLabelL2IndPRConstraints.addConstraint()

                throw new RuntimeException("Support for range constraints in PR in development. "
                  + penaltyOption.value);
              }
             
              if (!Double.isInfinite(dist[li][0])) {
                prConstraints.addConstraint(fi, li, dist[li][0], qGaussianVarianceOption.value);
              }
            }
          }
          constraintsList.add(prConstraints);
        }
View Full Code Here

Examples of choco.cp.model.CPModel.addConstraint()

   
    // constraints
    // repartition sur les plages horaires
    // les creneaux a placer ne doivent pas l'etre en meme temps
    Constraint c1 = Choco.disjunctive(creneauxAPlacer)
    m.addConstraint(c1);
   
    // precedences
    Constraint[] c2 = new Constraint[preced.length];
    for(int i = 0; i < c2.length; i++) {
      c2[i] = Choco.startsAfterBegin(preced[i].getCours2(), preced[i].getCours2(), preced[i].getDureeMinEntre());
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.