<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’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> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </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>
- Order is executable on each equipment.<br>
- Orders has different sizes.<br>
- Order running time is depending of the material and the equipment.<br>
- Gaps between orders are possible if there is no demand.<br>
- Gaps between orders are possible when there is a equipment setup time.<br>
- Parallel orders with same material on different equipment’s are possible.<br>
<br>
Target:<br>
- Calculate start and endtims for an order.<br>
- Start and endtime is precisely one minute (maximum five minutes if runtime is to long).<br>
- Satisfy only the demand of a material.<br>
- Good result in 5 minutes.<br>
- No exceed min or max stock.<br>
<br>
Plan data:<br>
- Plan for 24 hours.<br>
- Plan 35 orders (normal order time is 2 hours).<br>
- Plan 5 demands with different materials (7 orders per demand).<br>
- Plan 3 equipment’s.<br>
<br>
Problem:<br>
- No result in 5 minutes.<br>
- Concept with timeslots has to many possible order positions.<br>
- 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>
- 1 order (with 2 hours)<br>
- 1 equipment<br>
- 24 hours planning time with 1 timeslot per minute<br>
- Possible order positions = 22 * 60 = 1320 (on one equipment)<br>
- Possible order positions = 1320 * 3 = 3960 (on three equipment)<br>
- Possible order positions = 3960 * 35 = 138.600 (all orders on all equipment)<br>
<br>
<br>
rule "Check order not allocate to less."<br>
<br>
when<br>
$f : Order( $quantity : quantity , $m : material )<br>
<br>
$result : Number( (intValue > 0) && ( intValue < $quantity ) )<br>
from accumulate(<br>
EquipmentAllocation( order != null && order == $f , $sp : equipment.speedMap ),<br>
sum($sp.get($m))<br>
)<br>
then<br>
int hard = $result.intValue() - $quantity;<br>
scoreHolder.addHardConstraintMatch(kcontext, hard );<br>
end<br>
<br>
<br>
rule "Check order not allocate to many."<br>
<br>
when<br>
$f : Order( $quantity : quantity , $m : material )<br>
<br>
$result : Number( (intValue > 0) && ( intValue > $quantity ) )<br>
from accumulate(<br>
EquipmentAllocation(order != null && order == $f , $map : equipment.orderMap )<br>
sum( $map.get( $f ))<br>
)<br>
then<br>
int hard = $quantity - $result.intValue();<br>
scoreHolder.addHardConstraintMatch(kcontext, hard );<br>
end<br>
<br>
<br>
rule "Check demand"<br>
<br>
when<br>
$m : Material( $stock : stock )<br>
<br>
$t : TimeSlot( $sequence : sequence )<br>
<br>
$sumDemand : Number( )<br>
from accumulate (<br>
Demand ( timeSlot.sequence <= $sequence , material == $m , $quantity : quantity )<br>
sum( $quantity )<br>
)<br>
<br>
$sumAllocation : Number( ($stock + intValue - $sumDemand.intValue()) < 0 )<br>
from accumulate (<br>
EquipmentAllocation( (order != null && order.material == $m) , timeSlot.sequence <= $sequence , $sp : equipment.speedMap),<br>
sum( $sp.get($m) )<br>
)<br>
then<br>
scoreHolder.addHardConstraintMatch(kcontext, -1);<br>
end<br>
<br>
<br>
rule "Check min stock"<br>
<br>
when<br>
$m : Material( $stock : stock , $minStock : minStock, $maxStock : maxStock )<br>
<br>
$t : TimeSlot( $sequenceT : sequence )<br>
<br>
$sumDemand : Number( )<br>
from accumulate (<br>
Demand ( timeSlot.sequence <= $sequenceT , material == $m , $quantityDemand : quantity )<br>
sum( $quantityDemand )<br>
)<br>
<br>
$sumAllocation : Number( ($stock + (intValue) - $sumDemand.intValue()) < $minStock )<br>
from accumulate (<br>
EquipmentAllocation( order != null , order.material == $m , timeSlot.sequence <= $sequenceT , $sp : equipment.speedMap ),<br>
sum( $sp.get($m) )<br>
)<br>
then<br>
scoreHolder.addHardConstraintMatch(kcontext, -1);<br>
end<br>
<br>
<br>
rule "Check max stock"<br>
<br>
when<br>
$t : TimeSlot( $sequence : sequence )<br>
<br>
$m : Material( $stock : stock , $maxStock : maxStock )<br>
<br>
$sumDemand : Number( )<br>
from accumulate (<br>
Demand ( timeSlot.sequence <= $sequence , material == $m, $quantityDemand : quantity)<br>
sum( $quantityDemand )<br>
)<br>
<br>
$sumAllocation : Number( ($stock + intValue - $sumDemand.intValue()) > $maxStock )<br>
from accumulate (<br>
EquipmentAllocation( (order != null && order.material == $m) , timeSlot.sequence <= $sequence , $sp : equipment.speedMap ),<br>
sum( $sp.get($m) )<br>
)<br>
then<br>
scoreHolder.addHardConstraintMatch(kcontext, -1);<br>
end</span><span lang="EN-US" style="font-family:"Tahoma","sans-serif";color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Tahoma","sans-serif";color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-family:"Tahoma","sans-serif";color:black;mso-fareast-language:DE">Gruß<br>
<br>
</span><b><span style="font-size:12.0pt;font-family:"Tahoma","sans-serif";color:black;mso-fareast-language:DE">Michael Mohr</span></b><b><span style="font-size:12.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:DE"> </span></b><span style="font-size:14.0pt;font-family:"Arial","sans-serif";color:black;mso-fareast-language:DE"><br>
</span><span style="font-family:"Tahoma","sans-serif";color:black;mso-fareast-language:DE">Software Engineer
</span><span style="font-size:12.0pt;font-family:"Arial","sans-serif";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> </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>