Examples of addConstraint()


Examples of jsprit.core.problem.constraint.ConstraintManager.addConstraint()

        StateManager stateManager = new StateManager(vrp); //1.3.2-SNAPSHOT & upcoming release v1.4
//        StateManager stateManager = new StateManager(vrp.getTransportCosts()); //v1.3.1

        ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
        constraintManager.addConstraint(new NoBananasANDApplesConstraint(stateManager), ConstraintManager.Priority.CRITICAL);
//        constraintManager.addConstraint(new BananasFirst(),ConstraintManager.Priority.CRITICAL);

        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm vra = vraBuilder.build();
//        vra.setNuOfIterations(100); //1.3.2-SNAPSHOT
View Full Code Here

Examples of jsprit.core.problem.constraint.ConstraintManager.addConstraint()

        vraBuilder.addCoreConstraints();
        vraBuilder.addDefaultCostCalculators();

        StateManager stateManager = new StateManager(problem);
        ConstraintManager constraintManager = new ConstraintManager(problem,stateManager);
        constraintManager.addConstraint(geoClusterConstraint);

        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm algorithm = vraBuilder.build();

    algorithm.setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(100));
View Full Code Here

Examples of jsprit.core.problem.constraint.ConstraintManager.addConstraint()

        vraBuilder.addDefaultCostCalculators();
        vraBuilder.addCoreConstraints();

        StateManager stateManager = new StateManager(vrp);
        ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
        constraintManager.addConstraint(new ServiceDeliveriesFirstConstraint(), ConstraintManager.Priority.CRITICAL);

        vraBuilder.setStateAndConstraintManager(stateManager,constraintManager);
        VehicleRoutingAlgorithm vra = vraBuilder.build();

View Full Code Here

Examples of jsprit.core.problem.constraint.ConstraintManager.addConstraint()

        vehicleRoutingProblem = mock(VehicleRoutingProblem.class);
  }

  private void createInsertionCalculator(HardRouteConstraint hardRouteLevelConstraint) {
    ConstraintManager constraintManager = new ConstraintManager(mock(VehicleRoutingProblem.class), mock(RouteAndActivityStateGetter.class));
    constraintManager.addConstraint(hardRouteLevelConstraint);
    insertionCalculator = new ShipmentInsertionCalculator(routingCosts, activityInsertionCostsCalculator, constraintManager);
  }
 
  @Test
  public void whenInsertingServiceWhileNoCapIsAvailable_itMustReturnTheCorrectInsertionIndex(){
View Full Code Here

Examples of net.sf.validatedattrib.attribute.primitive.ValidatedDouble.addConstraint()

       
        ValidatedDouble validatedDouble = new ValidatedDouble();
        validatedDouble.setValue(value);
        assertTrue(validatedDouble.getValue() == value);
       
        validatedDouble.addConstraint(new ValidatedDoubleMinMaxConstraint(10, 100));
        validatedDouble.setValue(10);
       
        try {
            validatedDouble.setValue(101);
            fail("This should throw an ValidationException!");
View Full Code Here

Examples of net.sourceforge.squirrel_sql.plugins.mssql.sql.constraint.TableConstraints.addConstraint()

          def.setConstraintName(constraintName);
          def.addConstraintColumn(col);
          def.setDefaultExpression(constraintKeys);

          constraints.addConstraint(def);
        }
        else if (constraintType.startsWith("CHECK"))
        {
          CheckConstraint check = new CheckConstraint();
          String col = constraintType.substring(16).trim(); // chop off "CHECK on column ";
View Full Code Here

Examples of org.apache.accumulo.core.client.admin.NamespaceOperations.addConstraint()

    int numRun = 0;
    NAMESPACENOTFOUND: for (int i = 0;; ++i)
      try {
        switch (i) {
          case 0:
            ops.addConstraint(namespace, NumericValueConstraint.class.getName());
            fail();
          case 1:
            ops.attachIterator(namespace, setting);
            fail();
          case 2:
View Full Code Here

Examples of org.apache.accumulo.core.client.admin.TableOperations.addConstraint()

    numRun = 0;
    TABLENOTFOUNDEXCEPTIONS: for (int i = 0;; ++i)
      try {
        switch (i) {
          case 0:
            ops.addConstraint(tableName, NumericValueConstraint.class.getName());
            fail();
          case 1:
            ops.addSplits(tableName, new TreeSet<Text>());
            fail();
          case 2:
View Full Code Here

Examples of org.apache.accumulo.server.constraints.ConstraintChecker.addConstraint()

          log.debug("Reloading constraints");
          cc = ConstraintLoader.load(extent.getTableId().toString());
        } catch (IOException e) {
          log.error("Failed to reload constraints for " + extent, e);
          cc = new ConstraintChecker();
          cc.addConstraint(new UnsatisfiableConstraint((short) -1, "Failed to reload constraints, not accepting mutations."));
        }
       
        constraintChecker.set(cc);
      }
     
View Full Code Here

Examples of org.apache.catalina.Context.addConstraint()

            SecurityConstraint sc = new SecurityConstraint();
            sc.addAuthRole("*");
            sc.addCollection(collection);
            sc.setAuthConstraint(true);
            sc.setUserConstraint(transportGuarantee);
            context.addConstraint(sc);
            context.addSecurityRole("default");

            //Set the proper authenticator
            if ("BASIC".equals(authMethod)) {
                context.addValve(new BasicAuthenticator());
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.