Optaplanner Score Corruption Using Bavet - optaplanner

java.lang.IllegalStateException: Score corruption ([30]hard/[0/30]soft): the workingScore (-3init/[-1850]hard/[-1/-1190]soft) is not the uncorruptedScore (-3init/[-1880]hard/[-1/-1220]soft) after completedAction (TWC(20301005) {TWC(20301008) -> TWC(20301008)}):
Hello, I got this error when running Vehicle Routing Solution. I didn't know what is the meaning of after completedAction (TWC(20301005) {TWC(20301008) -> TWC(20301008)}):.
TWC is TimeWindowCustomer, and have previousStandstill. But why Optaplanner change into same PlanningEntity TWC(20301008) -> TWC(20301008) ?

Let's leave aside the move itself - the reason why such a useless move is being executed is probably a bug. But even then there shouldn't be a score corruption; it's just an inefficient behavior.
If, when you use the default constraint stream implementation (DROOLS), the score corruption disappears, please file a bug report for us, with some code we can execute to reproduce the problem. Make sure you are using the latest version of OptaPlanner.
If the problem is still there even when using DROOLS, the problem is likely in your domain model.

Related

S71200 LSQL-Microsoft, Datatype changed, after copying Function Block - How do I fix this?

I am integrating SQL-Connection to one or our existing Siemens S7-1200 PLCs right now.
After copying a Function Block from a working project, one of the data types has changed and is causing trouble now.
Original:
Copied FB:
Does anybody know, how to fix this?
Someone in the Siemens-Forum could answer my question right away.
Leaving his answer here for the next person with my problem :
With the introduction of the OUC library in version V4.x, the TCON instruction, among other things, has changed. Try to update the program on the CPU. In this case, the prerequisite is that the CPU must have at least firmware version V4.1. There is also the risk that translation errors will occur in other places where the older versions were previously used. In this case, the PLC code would have to be adjusted accordingly.

Anylogic: truncated class error during optimization

I state that I am a beginner, here is my problem.
My model works perfectly when I run it with a normal simulation. Now I'm trying to optimize some parameters using the optimization experiment, I've followed all the steps of the official tutorial, but it doesn't work because I get "Exception during discrete event execution:
Truncated class file". The strange thing is that, looking into the console displaying the error, I see that some lines are referred to an old version of my model, for example:
java.lang.ClassFormatError: Truncated class file
at coffe_maker.Main._m1_1_delayTime_xjal(Main.java:14070)
The current model's name is coffee_maker_v2_6 so I don't understand why I get this kind of error, do you know if it is normal? What am I doing wrong?
The most likely cause is that you have Java code left in an 'unused' configuration of a Delay block's "Delay time" expression (e.g., it now has a static value but you had Java code in the now-switched-out dynamic value).
Unfortunately, AnyLogic sometimes still includes the switched-out code in the compiled class, and this can sometimes cause strange runtime errors such as that one.
If this does look to be the case, temporarily switch to the offending switched-out configuration and delete it before switching back to the correct one.
I have resolved: the problem was that, in every delay block of my model, the delay time was linked with a database reference (type code), now I am trying by tyiping the probability distributions in the delays directly and now the optimization works

Credential Provider V2 Combobox unexpected behavior

I've been developing our company's credential provider for windows 10 for almost a year now.
Now, I encountered a problem. I don't usually ask questions on forums, blogs, because in most cases I find the solution, but this time I've been struggling with an issue for a month now and I found the root of the problem.
Brief description of the problem itself: The credential provider uses a combobox, which worked before without a problem. Now, I rewrote the whole code to manage a big update, but a strange bug got into the system. The bug only occurs at a specific scenario. I'm developing and testing the code on my personal laptop.
The scenario:
1) The laptop is plugged in to my monitor / power, etc.
2) I make it go sleep.
3) I unplug all cables (including power).
4) I wake it up from sleep.
Than, the combobox doesn't show a default selected item, it's empty. When I drop it down, it shows all the necessary items. Than the credprov crashes and restarts, than everything is fine.
I know, that in similar "strange" scenarios, in most of the cases, a memory leak or something related causes the problem. When I check the event viewer it shows me c0000005, which is access violation. I started to debug where the violation is. Than I found out that the program refers the combobox item list array (actually vector in my case) at a very very high index (out of range could be the reason for the violation). The actual index is obviously stored in the "selectedComboItemIndex" variable (DWORD).
I was curious when did it change to this strange number, than I found an unexpected behavior.
The SetComboBoxSelectedValue method randomly gets called once (when the bug happens) with an insanely high index value. I don't even call this method in my code, so I have no idea, why does it get called. The call happens even when I don't drop down the combobox.
I give it a chance that it could be a bug in the credprov itself. What do you think? Have you seen this problem before?
Thank you in advance!
I solved the problem by stopping to use "SetSelected" and "SetDeselected" methods. Furthermore, I filtered the "SetComboBoxSelectedValue" input parameters to accept valid numbers only. When the index parameter is invalid, I recall the same method with the index parameter replaced to the first item (0).

Titan storage.backend=inmemory Causes Incompatible Data Type Exception

I've been using titan-cassandra storage.backend=cassandra in my testing environment and recently learned that I can simply plop in storage.backend=inmemory to test with an in-memory graph. As this will drastically increase the speed of the hundreds of tests - this sounds great. But, making this change to my otherwise simple test configuration causes many of my once passing tests to fail. Here's my configuration:
storage.backend=inmemory
storage.hostname=localhost
storage.cassandra.keyspace=test
There are two errors that come up, the vast majority being:
java.lang.IllegalArgumentException: Incompatible data types for: variable
while much less commonly:
com.thinkaurelius.titan.core.TitanException: Could not commit transaction due to exception during persistence
Any idea on how I can resolve these issues?
I do my tests using in memory graph database too. While, I don't specify anything for hostname, I tried using, now, localhost, and it still works. I believe the problem might be somewhere else and you have fixed it by now.

drools 6.0.0.Beta3 NullPointerException

I am working with drools expert 6.0.0.Beta3 (latest available on the downloads page) and I am trying to update a rule existing in the working memory. Basically, I am calling add() of kBuilder again, like so:
kBuilder.add(org.drools.io.ResourceFactory.newByteArrayResource(drl.getBytes()),
org.drools.builder.ResourceType.DRL);
When I first add the rule, it gets added, and is even triggered when conditions meet. However, when calling add() again, as above, I get the following exception:
java.lang.NullPointerException
at org.drools.compiler.compiler.PackageBuilder.validateUniqueRuleNames(PackageBuilder.java:1314)
at org.drools.compiler.compiler.PackageBuilder.initPackageRegistry(PackageBuilder.java:916)
at org.drools.compiler.compiler.PackageBuilder.addPackage(PackageBuilder.java:869)
at org.drools.compiler.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:474)
at org.drools.compiler.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:670)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51)
at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:40)
at org.drools.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:34)
...
You are doing something wrong since trying to add the same DRL twice to the KnowledgeBuilder will end up in having the same rule twice in the KnowledgeBase. Honestly I'd be curious to know why you're trying this.
Anyway you should have a compilation issue reporting the duplicated rule name and not a NPE. This is definitively a bug that I reported here and already fixed on the master.
Thanks for having found this.