diff --git a/ortools/sat/docs/README.md b/ortools/sat/docs/README.md index 82df9dec24..d5f6111098 100644 --- a/ortools/sat/docs/README.md +++ b/ortools/sat/docs/README.md @@ -227,8 +227,8 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" cmpb "github.com/google/or-tools/ortools/sat/proto/cpmodel" - "ortools/sat/go/cpmodel" ) func simpleSatProgram() error { diff --git a/ortools/sat/docs/boolean_logic.md b/ortools/sat/docs/boolean_logic.md index db47873d84..bef7d6a775 100644 --- a/ortools/sat/docs/boolean_logic.md +++ b/ortools/sat/docs/boolean_logic.md @@ -114,7 +114,7 @@ package main import ( log "github.com/golang/glog" - "ortools/sat/go/cpmodel" + "github.com/google/or-tools/ortools/sat/go/cpmodel" ) func literalSampleSat() { @@ -248,7 +248,7 @@ public class BoolOrSampleSat package main import ( - "ortools/sat/go/cpmodel" + "github.com/google/or-tools/ortools/sat/go/cpmodel" ) func boolOrSampleSat() { @@ -434,7 +434,7 @@ public class ReifiedSampleSat package main import ( - "ortools/sat/go/cpmodel" + "github.com/google/or-tools/ortools/sat/go/cpmodel" ) func reifiedSampleSat() { @@ -526,9 +526,9 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" sppb "github.com/google/or-tools/ortools/sat/proto/satparameters" "google.golang.org/protobuf/proto" - "ortools/sat/go/cpmodel" ) func booleanProductSample() error { @@ -552,11 +552,11 @@ func booleanProductSample() error { } // Set `fill_additional_solutions_in_response` and `enumerate_all_solutions` to true so // the solver returns all solutions found. - params := sppb.SatParameters_builder{ + params := &sppb.SatParameters{ FillAdditionalSolutionsInResponse: proto.Bool(true), EnumerateAllSolutions: proto.Bool(true), SolutionPoolSize: proto.Int32(4), - }.Build() + } response, err := cpmodel.SolveCpModelWithParameters(m, params) if err != nil { return fmt.Errorf("failed to solve the model: %w", err) diff --git a/ortools/sat/docs/channeling.md b/ortools/sat/docs/channeling.md index f4811905ff..6feed79c20 100644 --- a/ortools/sat/docs/channeling.md +++ b/ortools/sat/docs/channeling.md @@ -309,10 +309,10 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" cmpb "github.com/google/or-tools/ortools/sat/proto/cpmodel" sppb "github.com/google/or-tools/ortools/sat/proto/satparameters" "google.golang.org/protobuf/proto" - "ortools/sat/go/cpmodel" ) func channelingSampleSat() error { @@ -344,12 +344,12 @@ func channelingSampleSat() error { if err != nil { return fmt.Errorf("failed to instantiate the CP model: %w", err) } - params := sppb.SatParameters_builder{ + params := &sppb.SatParameters{ FillAdditionalSolutionsInResponse: proto.Bool(true), EnumerateAllSolutions: proto.Bool(true), SolutionPoolSize: proto.Int32(11), SearchBranching: sppb.SatParameters_FIXED_SEARCH.Enum(), - }.Build() + } response, err := cpmodel.SolveCpModelWithParameters(m, params) if err != nil { return fmt.Errorf("failed to solve the model: %w", err) @@ -896,7 +896,7 @@ import ( "fmt" log "github.com/golang/glog" - "ortools/sat/go/cpmodel" + "github.com/google/or-tools/ortools/sat/go/cpmodel" ) const ( diff --git a/ortools/sat/docs/integer_arithmetic.md b/ortools/sat/docs/integer_arithmetic.md index 1a7e0e3aac..7fac0f7d1e 100644 --- a/ortools/sat/docs/integer_arithmetic.md +++ b/ortools/sat/docs/integer_arithmetic.md @@ -276,8 +276,8 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" cmpb "github.com/google/or-tools/ortools/sat/proto/cpmodel" - "ortools/sat/go/cpmodel" ) const numAnimals = 20 @@ -676,10 +676,10 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" cmpb "github.com/google/or-tools/ortools/sat/proto/cpmodel" sppb "github.com/google/or-tools/ortools/sat/proto/satparameters" "google.golang.org/protobuf/proto" - "ortools/sat/go/cpmodel" ) const ( @@ -719,12 +719,12 @@ func earlinessTardinessCostSampleSat() error { if err != nil { return fmt.Errorf("failed to instantiate the CP model: %w", err) } - params := sppb.SatParameters_builder{ + params := &sppb.SatParameters{ FillAdditionalSolutionsInResponse: proto.Bool(true), EnumerateAllSolutions: proto.Bool(true), SolutionPoolSize: proto.Int32(21), SearchBranching: sppb.SatParameters_FIXED_SEARCH.Enum(), - }.Build() + } response, err := cpmodel.SolveCpModelWithParameters(m, params) if err != nil { return fmt.Errorf("failed to solve the model: %w", err) @@ -1132,10 +1132,10 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" cmpb "github.com/google/or-tools/ortools/sat/proto/cpmodel" sppb "github.com/google/or-tools/ortools/sat/proto/satparameters" "google.golang.org/protobuf/proto" - "ortools/sat/go/cpmodel" ) func stepFunctionSampleSat() error { @@ -1185,12 +1185,12 @@ func stepFunctionSampleSat() error { if err != nil { return fmt.Errorf("failed to instantiate the CP model: %w", err) } - params := sppb.SatParameters_builder{ + params := &sppb.SatParameters{ FillAdditionalSolutionsInResponse: proto.Bool(true), EnumerateAllSolutions: proto.Bool(true), SolutionPoolSize: proto.Int32(21), SearchBranching: sppb.SatParameters_FIXED_SEARCH.Enum(), - }.Build() + } response, err := cpmodel.SolveCpModelWithParameters(m, params) if err != nil { return fmt.Errorf("failed to solve the model: %w", err) diff --git a/ortools/sat/docs/model.md b/ortools/sat/docs/model.md index 2218611998..1bc3f3ce50 100644 --- a/ortools/sat/docs/model.md +++ b/ortools/sat/docs/model.md @@ -311,8 +311,8 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" cmpb "github.com/google/or-tools/ortools/sat/proto/cpmodel" - "ortools/sat/go/cpmodel" ) func solutionHintingSampleSat() error { diff --git a/ortools/sat/docs/scheduling.md b/ortools/sat/docs/scheduling.md index 00aacda186..091ab8891f 100644 --- a/ortools/sat/docs/scheduling.md +++ b/ortools/sat/docs/scheduling.md @@ -196,7 +196,7 @@ import ( "fmt" log "github.com/golang/glog" - "ortools/sat/go/cpmodel" + "github.com/google/or-tools/ortools/sat/go/cpmodel" ) const horizon = 100 @@ -422,7 +422,7 @@ import ( "fmt" log "github.com/golang/glog" - "ortools/sat/go/cpmodel" + "github.com/google/or-tools/ortools/sat/go/cpmodel" ) const horizon = 100 @@ -842,8 +842,8 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" cmpb "github.com/google/or-tools/ortools/sat/proto/cpmodel" - "ortools/sat/go/cpmodel" ) const horizon = 21 // 3 weeks @@ -1866,8 +1866,8 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" cmpb "github.com/google/or-tools/ortools/sat/proto/cpmodel" - "ortools/sat/go/cpmodel" ) const ( diff --git a/ortools/sat/docs/solver.md b/ortools/sat/docs/solver.md index 6feee57dde..6bff2619c0 100644 --- a/ortools/sat/docs/solver.md +++ b/ortools/sat/docs/solver.md @@ -195,10 +195,10 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" cmpb "github.com/google/or-tools/ortools/sat/proto/cpmodel" sppb "github.com/google/or-tools/ortools/sat/proto/satparameters" "google.golang.org/protobuf/proto" - "ortools/sat/go/cpmodel" ) func solveWithTimeLimitSampleSat() error { @@ -217,9 +217,9 @@ func solveWithTimeLimitSampleSat() error { } // Sets a time limit of 10 seconds. - params := sppb.SatParameters_builder{ + params := &sppb.SatParameters{ MaxTimeInSeconds: proto.Float64(10.0), - }.Build() + } // Solve. response, err := cpmodel.SolveCpModelWithParameters(m, params) @@ -536,9 +536,9 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" sppb "github.com/google/or-tools/ortools/sat/proto/satparameters" "google.golang.org/protobuf/proto" - "ortools/sat/go/cpmodel" ) func solveAndPrintIntermediateSolutionsSampleSat() error { @@ -562,10 +562,10 @@ func solveAndPrintIntermediateSolutionsSampleSat() error { // Currently, the CpModelBuilder does not allow for callbacks, so intermediate solutions // cannot be printed while solving. However, the CP-SAT solver does allow for returning // the intermediate solutions found while solving in the response. - params := sppb.SatParameters_builder{ + params := &sppb.SatParameters{ FillAdditionalSolutionsInResponse: proto.Bool(true), SolutionPoolSize: proto.Int32(10), - }.Build() + } response, err := cpmodel.SolveCpModelWithParameters(m, params) if err != nil { return fmt.Errorf("failed to solve the model: %w", err) @@ -873,9 +873,9 @@ import ( "fmt" log "github.com/golang/glog" + "github.com/google/or-tools/ortools/sat/go/cpmodel" sppb "github.com/google/or-tools/ortools/sat/proto/satparameters" "google.golang.org/protobuf/proto" - "ortools/sat/go/cpmodel" ) func searchForAllSolutionsSampleSat() error { @@ -895,11 +895,11 @@ func searchForAllSolutionsSampleSat() error { // Currently, the CpModelBuilder does not allow for callbacks, so each feasible solution cannot // be printed while solving. However, the CP Solver can return all of the enumerated solutions // in the response by setting the following parameters. - params := sppb.SatParameters_builder{ + params := &sppb.SatParameters{ EnumerateAllSolutions: proto.Bool(true), FillAdditionalSolutionsInResponse: proto.Bool(true), SolutionPoolSize: proto.Int32(27), - }.Build() + } response, err := cpmodel.SolveCpModelWithParameters(m, params) if err != nil { return fmt.Errorf("failed to solve the model: %w", err)