Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
$ontents of presentation
%hat is Open Source &he open source future for O' (u)( *enrating a +ield ,rontier ith (u)( &raveling tournement pro-lem ith (u)( ,urther (u)( e.amples
/ Students can not afford commercial licences of this soft are / Students cannot see ho this soft are orks.
2 ... soft are .. -uilt like cathedrals0 carefully crafted -y individual i#ards or small -ands of mages orking in splendid isolation0 ith no -eta to -e released -efore its time Eric S. 'aymond
2 $olla-oration
/ &he a-ility for anyone to make improvements
2 (eer 'evie 1
/ A community that pushes for constant improvement and code Cuality
(u)(
/ (u)( is a python module that allo s the easy e.pression of Mathematical (rograms / (u)( is -uilt to interface ith separate solvers / (u)( is similar in style to1
2 AM() 2 *AMS 2 O() 2 )IN*O 2 ,)O($HH etc.
(u)(
/ %hy (ythonB
2 $ore (ython synta. leads to the concise statement of M(9s 2 (ython is a scripting language so no compilation is needed and the code is platform independent 2 (ython interfaces easily ith e.ternal solvers that do the heavy lifting 2 (ython comes ith 9-atteries included9
/ &he (ython standard li-rary is huge
(u)(
/ %ritten initially -y I. S. 'oy / No maintained -y S. A. Mitchell / It is availa-le at http1??pulp=or.google=code.com / No availa-le for %indo s and )inu.
lp L )p(ro-lemD;Aucking Model;0 )pMa.imi#eE Mset up the logvolume varia-les logvolL)pJaria-le.dictsD;)ogJolumeDN;OsN;E;0logtypes07E Mo-4ective lpHLlpSumDPl.price Q logvolPlR for l in logtypesRE0 ;'evenueS Msetup the arc varia-les .L)pJaria-le.dictD;.DOsE;0fTlogs07050)pIntegerE Mset up a section set partitioning pro-lem count L 7 for s in stems1 slogs L fsTlogsPsR for i0sec in enumerateDs.sectionsE1 lp HLD lpSumDD.PlogR for log in slogs if log.startl UL sec.start if log.endl V sec.startEE UL 5 0 ;StemTSectionDN;OsN;0OiE; O DstrDsE0iEE count HL 5 Madd the constraints that link the log volumes for lt in logtypes1 lp HLD lpSumDDlog.volumeQ.PlogR for log in flTlogsPltREE = logvolPltR LL 7 0 ;)ogtypeTvolumeDN;OsN;E; O strDltEE
D<:<05K>E
D70 7E
lp L )p(ro-lemD;&ravelling tournement Master;0 )pMinimi#eE Mcreate varia-les triplist L P&ripDt50pE for t5 in teams for p in allpermutationsDPt for t in teams if t FLt5R 0kE if pP7R UL pP=5RR tripvars L )pJaria-le.dictD;mastervar ;0triplist07050)pIntegerE Mo-4ective lp HL lpSumDPt.costDEQtripvarsPtR for t in triplistRE Mconstruct constraints to ensure that all teams visit each other for t5 in teams1 for t6 in teams1 if t5 FL t61 lp HL lpSumDPtripvarsPtR for t in triplist if t.team LL t5 if t6 in a.a ayteamsRE LL 50 N ;&eamTOsTJisitsTOs;ODt50t6E
,urther e.amples
/ &he :G6 course has -een converted from AM() to (u)(
http1??5:7.65X.67G.6:<?engsci:G6?pulp?Optimisation%ith(u)(
/ &here you can see a num-er of different ays to construct pro-lems / Note that ne language features can -e added very easily only needing approval from the AD,)