<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Sorry about this, my fault, I missed a line in the log. The initial score is getting calculated properly:<div><br></div><div><blockquote type="cite" class=""><div><font class="Apple-style-span" color="#000000">Feb 12, 2009 6:07:04 PM mx.edu.multigame.drools.SolverTest testSolverWithUndevelopedSolution</font></div><div><font class="Apple-style-span" color="#000000">INFO: Invoking solver, this should take a few minutes...</font></div><div><font class="Apple-style-span" color="#000000">Feb 12, 2009 6:07:04 PM org.slf4j.impl.JCLLoggerAdapter info</font></div><div><font class="Apple-style-span" color="#000000">INFO: Solving with random seed (0).</font></div><div><font class="Apple-style-span" color="#000000"><b>Undeveloped territory constraint tripped! 39</b></font></div><div><font class="Apple-style-span" color="#000000"><b>Feb 12, 2009 6:07:04 PM org.slf4j.impl.JCLLoggerAdapter info</b></font></div><div><font class="Apple-style-span" color="#000000"><b>INFO: Initialization time spend (14) for score (-5000004.0). Updating best solution and best score.</b></font></div><div><font class="Apple-style-span" color="#000000">Undeveloped territory constraint tripped! 39</font></div></blockquote><div> </div><div>I definitely see your point with regards to my loop insertion; the solution continues to degrade. I like your final suggested rule as well, I'll try that out today.</div><div><br></div><div>best wishes,</div><div><br></div><div>Andrew</div><div><br></div><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div><div><div><div>---------------------------------</div><div>Andrew Waterman</div><div>San Cristóbal de las Casas, Chiapas, Mexico</div><div>+52 1 967 107 5902</div><div>+1 510 342 5693</div><div><br></div></div></div></div></div></div></div></span> </div><br><div><div>On Feb 13, 2009, at 8:50 AM, Geoffrey De Smet wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>With kind regards,<br>Geoffrey De Smet<br><br><br>Andrew Waterman schreef:<br><blockquote type="cite">Hi,<br></blockquote><blockquote type="cite">I've been looking through my solver logs and on a problem i have posed, the solver seems to first initialize and setup a best score:<br></blockquote><blockquote type="cite">INFO: Initialization time spend (3) for score (-5000004.0). Updating best solution and best score.<br></blockquote><blockquote type="cite">However, this score is not correct. I use collect to load Tokens of a certain type for my game, and those that are found, penalize the system with a constraint:<br></blockquote><blockquote type="cite">rule "Too much unclaimed territory"<br></blockquote><blockquote type="cite"> when<br></blockquote><blockquote type="cite"> $list : ArrayList ( size > 2) from collect (<br></blockquote><blockquote type="cite"> Token ($type : type == TokenType.UNDEVELOPED))<br></blockquote><blockquote type="cite"> then<br></blockquote><blockquote type="cite"> for (int i = 0; i < $list.size(); i++) {<br></blockquote><blockquote type="cite"> insertLogical (new IntConstraintOccurrence (<br></blockquote><blockquote type="cite"> "Too much unclaimed territory", ConstraintType.NEGATIVE_SOFT, 3, $list));<br></blockquote><br>Doesn't this insert the same logical fact in a loop? So only 1 instance actually remains in the working memory?<br>If you want to have to list.size() affect the score, just do:<br> 3 * list.size()<br><br><blockquote type="cite"> }<br></blockquote><blockquote type="cite">end<br></blockquote><br>Why use collect anyway?<br><br> when<br> $t1 : Token ($type : type == TokenType.UNDEVELOPED, id1 : id)<br> $t2 : Token ($type : type == TokenType.UNDEVELOPED, id > id1, id2 : id)<br> $t3 : Token ($type : type == TokenType.UNDEVELOPED, id > id2, id3 : id)<br><br>// maybe you need things like this: not Token ($type : type == TokenType.UNDEVELOPED, id > id3)<br> then<br> insertLogical (new IntConstraintOccurrence ("Too much unclaimed territory", ConstraintType.NEGATIVE_SOFT, 3, $t1, $t2, $t3));<br><br><blockquote type="cite">However, the initial score does not seem to account for these inserted facts. Due to this, all improving solutions are rejected, and I see no change in the solution the solver finds and my starting solution. Any suggestions on how to delay initialization? Or get the starting score to take into account this constraint (I've made it SOFT so the values aren't so hard to follow in the logs, it was initially a HARD constraint). I'd love to find a way around this problem, I've spent most of the day playing with different configurations (acceptors and foragers) trying to find a configuration that works for this base problem.<br></blockquote><blockquote type="cite">best wishes,<br></blockquote><blockquote type="cite">Andrew<br></blockquote><blockquote type="cite">---------------------------------<br></blockquote><blockquote type="cite">Andrew Waterman<br></blockquote><blockquote type="cite">San Cristóbal de las Casas, Chiapas, Mexico<br></blockquote><blockquote type="cite">+52 1 967 107 5902<br></blockquote><blockquote type="cite">+1 510 342 5693<br></blockquote><blockquote type="cite">------------------------------------------------------------------------<br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">rules-users mailing list<br></blockquote><blockquote type="cite"><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br></blockquote><blockquote type="cite"><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users<br></div></blockquote></div><br></div></body></html>