Naming phases

20 views
Skip to first unread message

Mateusz Ośko

unread,
Apr 26, 2022, 4:11:49 AMApr 26
to OptaPlanner development
Hi everybody,

I would like to ask what would be the best way of naming phases in a scenario when we run several local searches and/or heuristics. I want to declare those names in xml configuration file and I want to be able to access those names on certain events, like ending of a phase. 

I was thinking of using something like adding "name" customProperty to the xml file to every phase I have, but Im not sure where to put it exactly to make it work? 

The reason I want to have those names for is to expand logs and log the phase name when it starts/ends. 

Thanks in advance for any help!
Mateusz Ośko

Lukáš Petrovický

unread,
Apr 26, 2022, 6:51:20 AMApr 26
to optapla...@googlegroups.com
Mateusz,

as far as I know, it is currently simply not possible to name the phases.
That said, it does sound like a reasonable feature request for the future.

Regards!
 
--

Lukáš Petrovický

He/Him/His

Principal Software Engineer

lukas.pe...@redhat.com    IM: triceo/lpetrovi

My work week is Monday to Thursday.

Radovan Synek

unread,
Apr 26, 2022, 7:01:24 AMApr 26
to optapla...@googlegroups.com
Hello Mateusz,

as Lukas wrote, custom names of phases are currently not supported; OptaPlanner logs the phase type and index (in the order the phase is defined in the config.xml, starting from 0) as follows:
"Construction Heuristic phase (0) ended..."

Could you please share some examples of such custom phase names? What is the kind of information you are looking for in the logs?

Best regards,
Radek

--
You received this message because you are subscribed to the Google Groups "OptaPlanner development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to optaplanner-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/optaplanner-dev/CAEs6%2BmzVnXBBmmFo9nV6NoyftqLwG%3D6sLiAREuhYrJ%2BYXA4bWQ%40mail.gmail.com.


--

Radovan Synek

Principal Software Engineer, Business Automation

Red Hat EMEA

Brno, Czech Republic

Mateusz Ośko

unread,
May 4, 2022, 2:49:05 AMMay 4
to OptaPlanner development
Hello,

Thank you for your responses. 

Radek, to explain more about reasoning behind the need of naming phases: imagine you are having several slighty different xmls with different configuration and phases. Starting to solve a problem you are able to identify the scenario and use right xml file with right phases. In each configuration file you have several phases, because - for example - you want to implement different algorithm for first half of local search (to find most promising direction of wide possibilities) and then another one for the ending time (to search optimal local solution).

However, at some point, everything will become messy to oversee. You can have trust in your methodology and files and phases you use, but you fail to actually remember every detail and logs are suddenly useless as they don't answer most fundamental question - what exactly just have run?

So, to give example of such names, in my case it would might be something like: "InitialConstructionHeuresticPhase", "GreedyTabuSearchPhase", "BasicTabuSearchPhase" "StrictTabuSearchPhase", "FinalCorrectionsPhase"... And so on and so on. There are just so many combinations of possible algorithms and approaches to be combined in optaplanner, but in the end just from looking at logs you cannot determine which combination have run - instead you have to debug which xml file was fired and then read the phases from the right file. 

I hope this explains my need more. 

Lukáš, I would love to add feature request - what would be the best way to do it properly in your opinion? Where should I write it?

Regards,
Mateusz Ośko

Radovan Synek

unread,
May 4, 2022, 9:08:10 AMMay 4
to optapla...@googlegroups.com
Hello Mateusz,

thanks for illustrating your proposal; indeed, it's a nice candidate for an enhancement. Please file a new "Feature Request" issue in the following Jira project:

Thanks,
Radek

Reply all
Reply to author
Forward
0 new messages