1

We are using optaplanner for VRP. One challenge we have is many of our constraints are specific to a local area. For example, in one state Technician can't cross state line where as in other states technicians can cross state line.

Under such scenario we want create a generic solution where user can add hard constraints and generic solution pick that constraint from data base to provide solution.

Has anyone designed such a solution?

Thanks

ajd
  • 121
  • 1
  • 4
  • 11

1 Answers1

1

Either use different <scoreDrl> elements:

  • general.drl
  • ny-specific.drl
  • ca-specific.drl
  • tx-specific.drl
  • ...

Or if you need to solve a single dataset that contains both tx and ny employees, then do something like

class Employee {
    State state;
}

rule noCross
when
    Employee(state = "Texas") // doesn't apply to California
    // ... crosses lines
then
    ...
end
Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120