<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Sprechblasentext Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";}
span.E-MailFormatvorlage19
        {mso-style-type:personal;
        font-family:"Tahoma","sans-serif";
        color:black;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.E-MailFormatvorlage20
        {mso-style-type:personal-reply;
        font-family:"Tahoma","sans-serif";
        color:black;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-US"><br>
I must find start and end times for orders on different equipment&#8217;s in requirement of a stock.<br>
What can I do better to get faster a solution.<br>
<br>
I read the forum entries but it don't helps.<br>
- Scheduling events with varying durations - corrupted score<br>
- Time Slots vs Time Periods<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:black">Graphics</span></b><b><span lang="EN-US">
<span style="color:black">and detail </span>description in the pdf. <o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Domain model<br>
<br>
@PlanningEntity<br>
EquipmentAllocation has a Equipment<br>
EquipmentAllocation has a Order<br>
EquipmentAllocation has a TimeSlot<br>
------------------------------------------------------<br>
@PlanningVariable<br>
Order<br>
Attribute: quantity<br>
------------------------------------------------------<br>
TimeSlot<br>
Attribute: startTime, endTime, duration, sequenceNumber<br>
------------------------------------------------------<br>
Material<br>
Attribute: stock, minStock, maxStock<br>
------------------------------------------------------<br>
Material Demand has a TimeSlot<br>
Attribute: quantity<br>
------------------------------------------------------<br>
<br>
Conditions:<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Order is executable on each equipment.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Orders has different sizes.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Order running time is depending of the material and the equipment.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Gaps between orders are possible if there is no demand.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Gaps between orders are possible when there is a equipment setup time.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Parallel orders with same material on different equipment&#8217;s are possible.<br>
<br>
Target:<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Calculate start and endtims for an order.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Start and endtime is precisely one minute (maximum five minutes if runtime is to long).<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Satisfy only the demand of a material.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Good result in 5 minutes.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; No exceed min or max stock.<br>
<br>
Plan data:<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Plan for 24 hours.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Plan 35 orders (normal order time is 2 hours).<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Plan 5 demands with different materials (7 orders per demand).<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Plan 3 equipment&#8217;s.<br>
<br>
Problem:<br>
-&nbsp; &nbsp; &nbsp; &nbsp; No result in 5 minutes.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Concept with timeslots has to many possible order positions.<br>
-&nbsp; &nbsp; &nbsp; &nbsp; No restrictions are possible to find the best solution.<br>
<br>
Use a pillar swap to create the possible order positions on each equipment.<br>
Use a pillar swap to lay the order over a lot of timeslots on a equipment.<br>
<br>
Example:<br>
-&nbsp; &nbsp; &nbsp; &nbsp; 1 order (with 2 hours)<br>
-&nbsp; &nbsp; &nbsp; &nbsp; 1 equipment<br>
-&nbsp; &nbsp; &nbsp; &nbsp; 24 hours planning time with 1 timeslot per minute<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Possible order positions = 22 * 60 = 1320 (on one equipment)<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Possible order positions = 1320 * 3 = 3960 (on three equipment)<br>
-&nbsp; &nbsp; &nbsp; &nbsp; Possible order positions = 3960 * 35 = 138.600 (all orders on all equipment)<br>
<br>
<br>
rule &quot;Check order not allocate to less.&quot;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; when<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $f : Order( $quantity : quantity , $m : material )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result : Number( (intValue &gt; 0) &amp;&amp; ( intValue &lt; $quantity ) )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from accumulate(<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EquipmentAllocation( order != null &amp;&amp; order == $f , $sp : equipment.speedMap ),<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; sum($sp.get($m))<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br>
&nbsp; &nbsp; &nbsp; &nbsp; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int hard = $result.intValue() - $quantity;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scoreHolder.addHardConstraintMatch(kcontext, hard );<br>
end<br>
<br>
<br>
rule &quot;Check order not allocate to many.&quot;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; when<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $f : Order( $quantity : quantity , $m : material )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $result : Number( (intValue &gt; 0) &amp;&amp; ( intValue &gt; $quantity ) )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from accumulate(<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EquipmentAllocation(order != null &amp;&amp; order == $f , $map : equipment.orderMap )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sum( $map.get( $f ))<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br>
&nbsp; &nbsp; &nbsp; &nbsp; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int hard = $quantity - $result.intValue();<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scoreHolder.addHardConstraintMatch(kcontext, hard );<br>
end<br>
<br>
<br>
rule &quot;Check demand&quot;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; when<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $m : Material( $stock : stock )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $t : TimeSlot( $sequence : sequence )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sumDemand : Number( )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from accumulate (<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Demand ( timeSlot.sequence &lt;= $sequence , material == $m , $quantity : quantity )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; sum( $quantity )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sumAllocation : Number( ($stock &#43; intValue - $sumDemand.intValue()) &lt; 0 )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from accumulate (<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; EquipmentAllocation( (order != null &amp;&amp; order.material == $m) , timeSlot.sequence &lt;= $sequence , $sp : equipment.speedMap),<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sum( $sp.get($m) )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br>
&nbsp; &nbsp; &nbsp; &nbsp; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scoreHolder.addHardConstraintMatch(kcontext,&nbsp; -1);<br>
end<br>
<br>
<br>
rule &quot;Check min stock&quot;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; when<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $m : Material( $stock : stock , $minStock : minStock, $maxStock : maxStock )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $t : TimeSlot( $sequenceT : sequence )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sumDemand : Number( )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from accumulate (<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Demand ( timeSlot.sequence &lt;= $sequenceT , material == $m , $quantityDemand : quantity )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; sum( $quantityDemand )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sumAllocation : Number( ($stock &#43; (intValue) - $sumDemand.intValue()) &lt; $minStock )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from accumulate (<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; EquipmentAllocation( order != null , order.material == $m , timeSlot.sequence &lt;= $sequenceT , $sp : equipment.speedMap ),<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sum( $sp.get($m) )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br>
&nbsp; &nbsp; &nbsp; &nbsp; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scoreHolder.addHardConstraintMatch(kcontext,&nbsp; -1);<br>
end<br>
<br>
<br>
rule &quot;Check max stock&quot;<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; when<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $t : TimeSlot( $sequence : sequence )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $m : Material( $stock : stock , $maxStock : maxStock )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sumDemand : Number( )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from accumulate (<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Demand ( timeSlot.sequence &lt;= $sequence , material == $m, $quantityDemand : quantity)<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; sum( $quantityDemand )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br>
<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sumAllocation : Number( ($stock &#43; intValue - $sumDemand.intValue()) &gt; $maxStock )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; from accumulate (<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; EquipmentAllocation( (order != null &amp;&amp; order.material == $m) , timeSlot.sequence &lt;= $sequence , $sp : equipment.speedMap ),<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sum( $sp.get($m) )<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; )<br>
&nbsp; &nbsp; &nbsp; &nbsp; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; scoreHolder.addHardConstraintMatch(kcontext,&nbsp; -1);<br>
end</span><span lang="EN-US" style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:DE">Gruß<br>
<br>
</span><b><span style="font-size:12.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:DE">Michael Mohr</span></b><b><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:DE">&nbsp;</span></b><span style="font-size:14.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:DE"><br>
</span><span style="font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:DE">Software Engineer
</span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:DE"><o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0" width="400" style="width:300.0pt">
<tbody>
<tr>
<td width="50" style="width:37.5pt;padding:0cm 0cm 0cm 0cm"></td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and delete the e-mail from your system. You are not authorized
 to disclose the contents to another person, to use it for any purpose or store or copy the information in any medium.<br>
</font>
</body>
</html>