Drools Planner Move - move

I don't have a lot of experience programming, let alone with Drools, but I am doing a project similar to the one of vehicle routing. Almost everything works fine, except for some moves, depending on the random seed.
The problem is that, once the Heuristic phase is done, sometimes the local search phase makes some strange moves, like the next one:
Heuristic phase solution:
day 1: place 1 -> place 2 -> place 3 -> place 4 -> place 5 -> place 6
day 2: place 7 -> place 8 -> place 9 -> place 10
Local search move: place 5 moved to day 2
Solution:
day 1: place 1 -> place 2 -> place 3 -> place 4
day 2: place 5 -> place 6
The rest of places is left with no day (in the example it would be vehicle), and they are left as an unanchored chain:
place 7 -> place 8 -> place 9 -> place 10 -> place 7 -> etc
So, when the program looks for the day of any of them, it enters an infinite loop. Obviously, the problem is not how to get out of that loop (I'm not that noob), it is how to avoid those movements.
I use the same solver configuration as the example (changing the solver class etc.) so I don't understand why it does those moves. I think that I should code my own Move class, but I can't find examples of how to code it, nor the MoveFactory. I leave the solver.xml in a code block.
Links or tips that would help me learn to code a Move and a MoveFactory class would be helpful, as well as configuration tips to avoid that (if there are any).
Anyway, thank you all for your time and effort.
<?xml version="1.0" encoding="UTF-8"?>
<solver>
<!--<environmentMode>DEBUG</environmentMode>-->
<environmentMode>PRODUCTION</environmentMode>
<solutionClass>org.tourgune.planificador.bean.Turista</solutionClass>
<planningEntityClass>org.tourgune.planificador.bean.PuntoInteres</planningEntityClass>
<scoreDirectorFactory>
<scoreDefinitionType>HARD_AND_SOFT</scoreDefinitionType>
<scoreDrl>/org/tourgune/planificador/core/planificadorScoreRules.drl</scoreDrl>
</scoreDirectorFactory>
<termination>
<maximumMinutesSpend>4</maximumMinutesSpend>
</termination>
<constructionHeuristic>
<constructionHeuristicType>FIRST_FIT</constructionHeuristicType>
</constructionHeuristic>
<localSearch>
<selector>
<selector>
<moveFactoryClass>org.drools.planner.core.move.generic.GenericChainedChangeMoveFactory</moveFactoryClass>
</selector>
<selector>
<moveFactoryClass>org.drools.planner.core.move.generic.GenericChainedChangePartMoveFactory</moveFactoryClass>
</selector>
<!-- TODO needs a GenericChainedSwapMoveFactory and probably even a GenericChainedSwapPartMoveFactory -->
</selector>
<acceptor>
<planningEntityTabuSize>10</planningEntityTabuSize>
</acceptor>
<forager>
<minimalAcceptedSelection>0</minimalAcceptedSelection>
</forager>
</localSearch>
<!--<localSearch>-->
<!--<selector>-->
<!--<selector>-->
<!--<moveFactoryClass>org.drools.planner.core.move.generic.GenericChainedChangeMoveFactory</moveFactoryClass>-->
<!--</selector>-->
<!--<selector>-->
<!--<moveFactoryClass>org.drools.planner.core.move.generic.GenericChainedChangePartMoveFactory</moveFactoryClass>-->
<!--</selector>-->
<!--</selector>-->
<!--<acceptor>-->
<!--<simulatedAnnealingStartingTemperature>10</simulatedAnnealingStartingTemperature>-->
<!--</acceptor>-->
<!--<forager>-->
<!--<minimalAcceptedSelection>4</minimalAcceptedSelection>-->
<!--</forager>-->
<!--</localSearch>-->
</solver>

Upgrade to 5.5.0.Final first, so you can just use <changeMoveSelector/> instead of those generic factories. Follow the upgrade recipe txt.
If you still have the problem then, enable DEBUG to detect score corruption (usually caused by the clone method or hacky score rules). OptaPlanner (= Drools Planner) 6.0 will make it easier to write score rules and make it much less likely that you face score corruption.

Related

cudnn without any framework

Does anyone have an idea, what is matched wrong.
It compiles without any error, etc., but the Output goes always from Predict class 5 to 3 to 1 and doesnt change.
Code(important here PropagationHelper&Network&Layer):
Output:
Update Weight(Value of ConvGradConv is to huge!)
Networkflow(first 5 and last 5 data in each layer)
Okay one Error corrected(FullyBackward used inchannel insteed of inputsize), but there must be another one with the ConvLayer.

Can Sphinx Section Numbering Skip Certain Sections (like a title)?

I am making a series of design documents in Sphinx and I would like to include them together in a toctree and have the sections within the documents numbered. I know that I can use .. sectnum:: to number all sections in the child pages. However, Sphinx/rst numbers the title of the page (which is really just the first section) and the table of contents ends up looking like:
Table of Contents
1 Design the First
2 Design the Second
and each child page looks like:
1 Design the First
1.1 First Section
1.2 Second Section
What I want is a table of contents on my index page that just lists the title
Table of Contents
Design The First
Design the Second
and child page that look like
Design the First
1 First Section
2 Second Section
Is there a way to have a title that shows up in the TOC as well as on the top of a child page which does not end up being a numbered section?
I don't know what you ended up doing, but I wanted to do the exact same thing! I had the following setup:
index.rst
.. toctree::
assignment
library_api
I only wanted the assignment part to have numbers, so either could have done two separate toctree with one using :numbered:, or put at the top of the file
.. sectnum::
:start: 0
Giving of course the exact problem you mention -- my top-level title was Assignment Writeup, so that was 0 and everything below it in subsections was 0.x e.g.
Assignment Writeup
==================
First Task
----------
Second Task
-----------
gives
0. Assignment Writeup
0.1 First Task
0.2 Second Task
as it turns out, there's an easy hack you can do. It makes things more modular than probably desired, but "add a layer of indirection".
So now I have assignment.rst and assignment_writeup.rst. assignment.rst just basically has a title and a toctree:
Assignment Writeup
==================
.. toctree::
:maxdepth: 4
assignment_writeup
then take all sub-sections and put them in assignment_writeup and "upcast" their heading level. So I now take all subsections and make them sections, and subsub and make them sub.
.. sectnum::
:start: 0
First Task
==========
^^^ === instead of --- now
Second Task
===========
and we now finally have
Assignment Writeup
0. First Task
1. Second Task
kind of dubious, but this was the only way I could achieve it x0 I wonder what you did between asking this and now? Hopefully somebody will see this and benefit one day!
Note: this has undesireable side-effects. The Assignment Writeup shows up on its own page, with just Links to the indirect document. Not sure which is worse honestly...

How can I add 2 articulations to a note as part of a post-event?

I copied this example from here, and it works fine, working as if I had simply entered ->.
dashPlus = #(let ((m (make-music 'ArticulationEvent
'articulation-type "accent")))
(set! (ly:music-property m 'tweaks)
(acons 'font-size -3
(ly:music-property m 'tweaks)))
m)
However, I'm trying to figure out how to define a combination tenuto/marcato articulation, which somehow got changed somewhere during the Finale file -> MusicXML -> .ly process from what I entered into Finale (the combination articulation) to an individual marcato articulation and an individual tenuto articulation attached to the same note (-- ->).
How can I change this to add not only one accent, but a combination of both, and also somehow manipulate the articulations' script-priority values so that the tenuto is always stacked closest to the staff? (I'm afraid my grasp of Scheme isn't too strong. I understand a few things but this is all way over my head.)

Mozart Ozcar Debugger Error

So im studying, and i need to run Ozcar debugger including on Mozart, i go to Oz menu and first i pick feed buffer, after that i pick Start Debugger, the compiler show me the next message:
local A B in
A = 5
B = 6
{Browse A+B}
end
% -------------------- accepted
\localSwitches
\switch +threadedqueries -verbose -expression -runwithdebugger
{Ozcar.open}
% -------------------- accepted
And then it suppose that a auxiliary windows should appears but nothing happens!!!! I need help pls!!!
Also the Oz emulator show me this:
%********************** Error: module manager *******************
%**
%** Could not link module
%**
%** Could not load functor at URL: x-oz://system/Ozcar.ozf
%**--------------------------------------------------------------
I think that the packagge of Ozcar is missing, where i can find it or how i can solve this???
You should use Mozart 1.4.0, the latest version of the 1.x Mozart branch.
Even if this question is more than 3 years old, the development of Mozart 2 is really slow and there still are a lot of features missing.

Is there a name for this type of page navigation?

Just out of curiosity, is there a name for the kind of navigation I've been working on?
It looks like this:
<<first <previous 1 2 3 4 5 [...] 20 next> last>>
i.e. navigation where you've got x pages, but you don't want to show x links, you want to limit the amount of space taken up, so you show y links at a time, and indicate the existence of the other pages with an elision.
At some point in the middle, it would look like this:
<<first <previous [...] 8 9 10 11 12 [...] 20 next> last>>
with elisions on both sides.
Answering to just clear up this question. I hereby declare that it has no official name.
I also hereby make up the name 'elided pagination' for it.
It's called web pagination, search result pagination.
thresholded navigation pager?
Not sure what the ordinary version of this pagination scheme is called (if anything).
However, I came up with an advanced version of it capable of handling very large numbers of pages (where ellipses (...) skip successively larger blocks of pages as you get further away from either the current page or the endpoints).
I called my scheme "Logarithmic pagination" or "Logarithmic page navigation".
You can find it (with implementation) on stackoverflow here.

Resources