<div dir="ltr"><div>I mean, i know how it is called, it is inside the xml configuration:<br>----------<br>  &lt;!-- Domain model configuration --&gt;<br>  &lt;solutionClass&gt;org.drools.planner.examples.cloudbalancing.domain.CloudBalance&lt;/solutionClass&gt;<br>
  &lt;planningEntityClass&gt;org.drools.planner.examples.cloudbalancing.domain.CloudProcess&lt;/planningEntityClass&gt;<br><br>  &lt;!-- Score configuration --&gt;<br>  &lt;scoreDirectorFactory&gt;<br>    &lt;scoreDefinitionType&gt;HARD_AND_SOFT&lt;/scoreDefinitionType&gt;<br>
    &lt;simpleScoreCalculatorClass&gt;org.drools.planner.examples.cloudbalancing.solver.score.CloudBalancingSimpleScoreCalculator&lt;/simpleScoreCalculatorClass&gt;--&gt;<br>    <br>  &lt;/scoreDirectorFactory&gt;<br>---------<br>
<br></div>i want to understant the java class doing the assign to cloudcomputers. I don&#39;t see any setCloudProcess to a CloudComputer, even so, when the planner ends, all process have been distributed to cloudcomputer. That&#39;s what I am trying to understand, how does it works. I did a debug but i didn&#39;t catch the moment a cloud computer receives a cloudprocess<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/2/7 Geoffrey De Smet <span dir="ltr">&lt;<a href="mailto:ge0ffrey.spam@gmail.com" target="_blank">ge0ffrey.spam@gmail.com</a>&gt;</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&#39;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 &lt; 0) {<br>
                          hardScore += cpuPowerAvailable;<br>
                      }<br>
                      int memoryAvailable = computer.getMemory() -
          memoryUsage;<br>
                      if (memoryAvailable &lt; 0) {<br>
                          hardScore += memoryAvailable;<br>
                      }<br>
                      int networkBandwidthAvailable =
          computer.getNetworkBandwidth() - networkBandwidthUsage;<br>
                      if (networkBandwidthAvailable &lt; 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&#39;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&#39;s why it gets called.<br>
    <br>
    <blockquote type="cite">
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a 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 href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a 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>