<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">Op 07-02-13 16:10, Aijin Nakanishi
schreef:<br>
</div>
<blockquote
cite="mid:CA+9JSF6-Y5z_ite4_+3ZrA+eBAr1_jEa1iMcK+Q=99PV1U1J_A@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>I mean, i know how it is called, it is inside the xml
configuration:<br>
----------<br>
<!-- Domain model configuration --><br>
<solutionClass>org.drools.planner.examples.cloudbalancing.domain.CloudBalance</solutionClass><br>
<planningEntityClass>org.drools.planner.examples.cloudbalancing.domain.CloudProcess</planningEntityClass><br>
<br>
<!-- Score configuration --><br>
<scoreDirectorFactory><br>
<scoreDefinitionType>HARD_AND_SOFT</scoreDefinitionType><br>
<simpleScoreCalculatorClass>org.drools.planner.examples.cloudbalancing.solver.score.CloudBalancingSimpleScoreCalculator</simpleScoreCalculatorClass>--><br>
<br>
</scoreDirectorFactory><br>
---------<br>
<br>
</div>
i want to understant the java class doing the assign to
cloudcomputers. I don't see any setCloudProcess to a
CloudComputer, even so, when the planner ends, all process have
been distributed to cloudcomputer. That's what I am trying to
understand, how does it works. I did a debug but i didn't catch
the moment a cloud computer receives a cloudprocess<br>
</div>
</blockquote>
Determining the best setCloudProcess() value is Planner's job. And
Planner will try a bunch of those iteratively.<br>
Each of the optimization algorithms that Planner can use to do that,
are described in the manual.<br>
The quick starts uses First Fit Decreasing followed by Tabu Search
if I recall correctly.<br>
<br>
<blockquote
cite="mid:CA+9JSF6-Y5z_ite4_+3ZrA+eBAr1_jEa1iMcK+Q=99PV1U1J_A@mail.gmail.com"
type="cite">
<div dir="ltr">
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">2013/2/7 Geoffrey De Smet <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:ge0ffrey.spam@gmail.com" target="_blank">ge0ffrey.spam@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> <br>
<div>Op 07-02-13 15:43, Aijin Nakanishi schreef:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>I'm trying to understand when is proccess
assigned to a computer by that java example.<br>
<br>
----------------<br>
public HardAndSoftScore
calculateScore(CloudBalance cloudBalance) {<br>
int hardScore = 0;<br>
int softScore = 0;<br>
for (CloudComputer computer :
cloudBalance.getComputerList()) {<br>
int cpuPowerUsage = 0;<br>
int memoryUsage = 0;<br>
int networkBandwidthUsage = 0;<br>
boolean used = false;<br>
<br>
// Calculate usage<br>
for (CloudProcess process :
cloudBalance.getProcessList()) {<br>
if
(computer.equals(process.getComputer())) {<br>
cpuPowerUsage +=
process.getRequiredCpuPower();<br>
memoryUsage +=
process.getRequiredMemory();<br>
networkBandwidthUsage +=
process.getRequiredNetworkBandwidth();<br>
used = true;<br>
}<br>
}<br>
<br>
// Hard constraints<br>
int cpuPowerAvailable =
computer.getCpuPower() - cpuPowerUsage;<br>
if (cpuPowerAvailable < 0) {<br>
hardScore += cpuPowerAvailable;<br>
}<br>
int memoryAvailable =
computer.getMemory() - memoryUsage;<br>
if (memoryAvailable < 0) {<br>
hardScore += memoryAvailable;<br>
}<br>
int networkBandwidthAvailable =
computer.getNetworkBandwidth() -
networkBandwidthUsage;<br>
if (networkBandwidthAvailable < 0) {<br>
hardScore +=
networkBandwidthAvailable;<br>
}<br>
<br>
// Soft constraints<br>
if (used) {<br>
softScore -= computer.getCost();<br>
}<br>
}<br>
return
DefaultHardAndSoftScore.valueOf(hardScore,
softScore);<br>
}<br>
--------------------<br>
<br>
</div>
I didn't understand how the cloudcomputers received it<br>
</div>
</blockquote>
What do you mean?<br>
That ScoreCalculator is configured in the
SolverConfig.xml, so that's why it gets called.<br>
<br>
<blockquote type="cite"> <br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
</blockquote>
<br>
</div>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/rules-users"
target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></pre>
</blockquote>
<br>
</body>
</html>