1

I have solved a problem using optaPlanner using incremental java in which one planning variable and one planning Entity, But now in our project there is requirement in which many planning variables like we have to find the best Room(capacity, isAC etc etc) , Car(totalSeatsLeft , isAC etc etc ) and we do not know how many of resources are , Because everyday we need to add more resources as per the user requirement like conference room facility etc, So give me some idea so that we can make the Domain for Opta Planner. Thanks.

Gulnaz Ghanchi
  • 485
  • 3
  • 14
  • 1
    Why don't you know how many resources are needed? Try lab201 of the [training zip](http://www.optaplanner.org/learn/training.html). It will teach how to reverse your thinking and pick the right class/field to be a planning entity/variable. – Geoffrey De Smet Oct 29 '14 at 08:49
  • I know about all these , but let me clarify our problem to you .For Example we have to plan a Event , and for Event there are resources needed like Human Resource(depend on skills) , Rooms(depend on parking facility , A.C. etc) . Car Pooling facility depend on (Car and Location) etc . There are a lot of resources we have to plan , and may be the resource requirement change . Now We solve it for two planning variables Car and Rooms using incremental java . So , now my question is there any problem if we make many planning variables in a single planning Entity ? Thanks –  Oct 30 '14 at 04:19

1 Answers1

1

Each planning variable in an entity needs to be field. Currently OptaPlanner does not support having an array (or list) which is a planning variable. It's unclear if we 'll ever want to do that (because it introduces other issues).

Why doesn't something like this work?

@PlanningEntity class Event {
    long eventId;
    long eventName;
    @PlanningVariable Car car;
    @PlanningVariable Room room;
}
Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
  • Please read my Comment carefully . As I said earlier I solve it for 2 planning variables and it works , I just want to know if a Planning Entity have 10 planning variables or more does it work well ? I Solve for that problem for 2 planning variables as you suggested –  Oct 30 '14 at 10:58
  • I know its work well for 2 planning variables using incremental java , but we donot know how many resources are needed in future . Let suppose after 1 year we need 10 resources . So I just want to know , will it create the problem or not for many planning variables? –  Oct 30 '14 at 11:02
  • I know of cases with 5 planning variables and more. It's all fine. The only problem is the construction heuristics: they need to the "advanced configuration" as described in the manual to avoid doing a cartesian product of all variables (if that's getting too big). – Geoffrey De Smet Oct 30 '14 at 14:26
  • @Geoffry De Smet, Is it possible to have an array of Rooms as planning variable? https://stackoverflow.com/questions/48257903/optaplanner-list-planning-variable – MaheshVarma Jan 16 '18 at 00:27
  • Today, no. But I do have plans for an planning variable that is a list in a future version, mainly tfor VRP. There's a jira with the deep analysis. – Geoffrey De Smet Jan 18 '18 at 17:56
  • @GeoffreyDeSmet , is it possible to have a collection of resources (such as Array or List) as planning variable today? Or still do we have to set single planning variable ? – safakeskin Oct 22 '19 at 15:38
  • You probably want https://issues.jboss.org/browse/PLANNER-728 (unresolved) – Geoffrey De Smet Oct 23 '19 at 09:08