Figure1:Exampleofatimetableinourrepresentation
5.2 Databasemodel
ThedatathatwasoriginallyavailableintheOPUSsystemwasnotsucientforourourTimetabling
module. For r example,therewasnotablethatcontainedtheavailableroomsonthecampus. . To
keepthismodule‘plug-and-playable’wedesignedanextensionoftheoriginaldatabasemodel,in
whichweputthedataneededforthetimetablemodule. Ourversionisshownintheappendixin
Figure7.2. Themodelitselfisprettystraightforward,butwewillexplainsomespecicthingsin
it:
 ItisastandarddatabaseUMLmodeldesignedwithMicrosoftVisio2007.
 Data needed for theinput ofour algorithmcoloured blue. . Sothis s dataneedbe available
beforeouralgorithmstarts.
 Datathatouralgorithmwillgenerateisstoredintablesthatarecolouredgreen.
 Thetable‘subjectprerequisite’containsthesubjectsthatmustbeprecededbyanothersub-
ject.
 Thetable ‘room’is completely new. . Theeld‘responsible’contains s the personthat isre-
sponsiblefortheroom,intermsofkey-holder,beamer-installationetcetera. Theeld‘type’
containsthetypeofroom.Thiscanbe‘presentation’,‘standard’or‘special’.Wherespecial
meansthatitcanbeusedforphysicsorchemistry. Theeld‘location’cancontainthegeo-
graphicdatathatisneededtorepresentthephysicalplaceoftheroom.Thisisanoptionfor
thefuture: thiscanbeusedforaroutingalgorithmthatcalculatesthetraveltimebetween
twodierentrooms.
Thedatabase tablesneed only be createdonce, whenyou‘insert’ the timetable module. . Ifthe
moduleisremoved,thedataandtableswillstillbetherebutnotaccessiblefromwithintheopus
system.
5.3 Classmodel
Theclassmodelwedesignedneedssomemoreexplanation,itisshownintheappendixinFigure
7.3.ItisaUMLclassmodelalsomadewithMicrosoftVisio2007.Everyclasscontainsattributes
9
.Pdf to jpg - Convert PDF to JPEG images in C#.net, ASP.NET MVC, WinForms, WPF project
How to convert PDF to JPEG using C#.NET PDF to JPEG conversion / converter library control SDK
convert pdf into jpg online; bulk pdf to jpg converter
.Pdf to jpg - VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.net, ASP.NET MVC, WinForms, WPF project
Online Tutorial for PDF to JPEG (JPG) Conversion in VB.NET Image Application
convert pdf file into jpg format; pdf to jpeg
and operations s onthose attributes. . To o keepthe designclear and simple we left out alltrivial
functionslikegetters,settersanddatabaseconnectors.Wewillnowgiveanoverviewoftheclasses,
attributesandfunctions:
 InputInitialDataThisistheclasswherethealgorithmshouldstart.ThestaffMembers[]
andfinished[]arrayscontainthereferences(ID’s)totheassistantdeansofeveryschool,
who are responsible for r making g the timetables. . When n all assistant deans have e lled d the
database(colouredblueinthedatabasemodel)withtheappropriatedata,therunTimetabling()
functioncanbecalled,whichinitializeaninstanceof MemeticAlgorithm.
 MemeticAlgorithmThis isthemainfunctionofthealgorithm. . Itrststartsbyinitializing
thedataneededforthealgorithm,soweare workingonalocalcopyofthedatafromthe
database.ItthengeneratesaninitialpopulationpopulationandcallstheGeneticAlgorithm.
Thisalgorithmtakestheinitialpopulationoftimetablesandstartsreproducingnewones(op-
erationsselectParents()andreproduction()). Tokeepthetimetablesevolvingtowards
better ones,the algorithmmodies someelements in n the population witha smallchance.
(This is done by the operation n mutate()). . After r one run n of f the e GeneticAlgorithm, the
LocalSearchalgorithmiscalled,whichperformsindividuallearningoneveryelementinthe
population. This s individual l learning shouldbe implementedbysearchingfor r alocal l opti-
mum. Whenthe e LocalSearchalgorithmis nished,theMemeticAlgorithmstarts allover
again. Finally,whenenoughiterationsare e performed,the e MemeticAlgorithm m returns the
bestElementandlaunchestheOutputclass.
 Data The datais represented inthe same way as inthe database. . We e have colouredthe
datatypes yellow w that t are e already y in the e system. . That t is s also o why y we did not show w all
attributes. Ournewdatatypes s addnewattributesandinherit theothers fromtheexisting
datamodel,forinstanceTimetableStaffMemberinheritsfromstaffMember.
 PopulationThepopulationisrepresentedasacollectionofelements.Thesort()operation
mustoverridethenormalsort()functioninJava,becauseitmustsorttheelementsbasedon
theirtness.
 ElementOnesingleelement represents awholetimetableforaspecicperiod,modeledby
a matrix (alsoseeEquation1). . Dependingonwhat t kindoftimetable the user wants,the
subclassestimetableElementorexamTimetableElementareused.TheNotScheduledarray
containstheExamsorSubjectthatarenotyetinthetimetablematrix.
 Output Depending g on n what kind of f timetable the user wants, the Output class lls the
database(thetablescolouredgreeninthedatabasedesign)withthegeneratedbestElement.
How toimplement t the e specic classes s and operations, like e ‘evaluateFitness()’andthe memetic
algorithm,isdescribedinSection6
10
Online Convert Jpeg to PDF file. Best free online export Jpg image
Download Free Trial. Convert a JPG to PDF. Web Security. All your JPG and PDF files will be permanently erased from our servers after one hour.
convert pdf to jpg for; convert pdf file into jpg
Online Convert PDF to Jpeg images. Best free online PDF JPEG
Download Free Trial. Convert a PDF File to JPG. Web Security. Your PDF and JPG files will be deleted from our servers an hour after the conversion.
convert multi page pdf to jpg; best pdf to jpg converter online
5.4 Usecasesandactivitydiagrams
Wemadeseveralusecasesandactivitydiagrams.TheyareshowninSection7.4oftheappendix.
Becausethediagramsareprettystraightforward,wewillonlydiscusstherstone(seeFigure7.4).
Inthisactivitydiagram,thewholesystemisshown.Tomakethetimetablingprocessasuccessit
isnecessarythatallAssistantDeanshaveaddedcourses fromtheirown‘organizationalunit’and
thatallteachershaveeditedtheworktimestheyprefer. Whenallthisinformationisavailablefor
thesystem,thegeneratingcouldstart.
6 DetailedSystemDesign
Inthissectiontherewillbeamorein-depthlookintoanessentialpartofthetimetablingmodule;
thetimetablingalgorithm. Weexplainthealgorithmintextandinpseudo-code. Wewillalsogive
anindicationonhowtocreatethetnessevaluationfunction.
6.1 MemeticAlgorithm
Widelyknownbythegeneralpublicforhispopularizationofscienceandhisoutspokenathesm,
RichardDawkins is alsoarenownedbiologist,and d the one whocoinedtheconcept‘meme’;the
culturalequivalentofthegene. Itisthisconcept,whichstandsatthebasisofmemeticalgorithms,
anactivetopicofresearchinComputerScience.
InComputerScienceterminology,whatismeantbytheterm‘MemeticAlgorithm’isthecombi-
nationofagenericGeneticAlgorithm(SeeSection6.2)withaLocalSearchalgorithm(SeeSection
6.3)representingthe‘culturalrenement’ofmemetics. Eachmemeticalgorithmicstepisinfact
composedoutoftwodierentsteps.First,the‘individuals’ina‘population’areevaluatedaccord-
ing to aspecicgenetic implementationandits parameters, selected, andallowed to reproduce
‘ospring’. Thisisfollowedby y the feedingof(apartof)thisospringintothelocalsearchpart
ofthealgorithm,therebyfurtheroptimizingit. Thiscyclecontinuesuntilastoppingconditionis
reached.
An overview w of the Memetic c Algorithm in n pseudo-code e is s given n below, together with some
commentsonhowthiscanbere ectedongeneratingtimetablesfortheOPUSproject.
Procedure Memetic Algorithm
Generate an initial population; ; //Create a set of f (valid) ) timetables
while (Stopping g conditions are e not t satisfied) do
//Start genetic algorithm
Evaluate all l individuals s in the population. //Compute fitness for all
Select a set t of individuals, , sub;
Create offspring from sub; ; //Create e new timetables
Offspring replaces s the e worst individuals s in n population; //Order on fitness,
11
C# Image Convert: How to Convert Adobe PDF to Jpeg, Png, Bmp, &
String inputFilePath = @"C:\input.pdf"; String outputFilePath = @"C:\output.jpg"; // Convert PDF to jpg. C# sample code for PDF to jpg image conversion.
.pdf to .jpg online; convert pdf file into jpg format
C# Image Convert: How to Convert Tiff Image to Jpeg, Png, Bmp, &
RasterEdge.XDoc.PDF.dll. String inputFilePath = @"C:\input.tif"; String outputFilePath = @"C:\output.jpg"; // Convert tiff to jpg.
convert pdf to 300 dpi jpg; convert pdf to jpeg
//remove worst t X X in population,
//insert X offspring in population.
With a a small l chance, , do o an additional mutation; ; //E.g., swap subjects
//End genetic algorithm
//Start local l search
for each individual in population do
Perform individual learning; //Change all l timetables
end for
//End local l search
end while
The Genetic Algorithm (See section 6.2) ) and Local Search Algorithm (See e section 6.3) are
describedbelow.
Generatinganinitialpopulation(meaning:Aninitialsetoftimetables)isthebasicsetusedto
generatenew,andbetter,timetables. Thiscanbedoneinseveralwayssuchasrandomlypicking
subjectsandputtingthemintimeslots incertainrooms, , possibly y withthe constraints inmind.
Theconstraintscouldbecheckedwheninsertingeachnewsubjectintoaninitialtimetable. The
qualityoftheinitialtimetablesdoesnotmatterthatmuch,buttheallowingofbreachingofhard
constraintsmightmakeitmoredicultforthealgorithmtogeneratenewtimetablesfromtheold
(andwrong)ones.
Thestopconditionisthepointatwhichthealgorithmstops. Forthiswehave2choices:
 Stopafteraxednumberofruns
 Stopafteragoobtimetablehasbeenfound.Here,‘good’isdeterminedbythetnessfunction.
6.2 GeneticAlgorithm
Procedure Genetic Algorithm
Evaluate all l individuals s in the population. //Compute fitness for all
Select a set t of individuals, , sub;
Create offspring from sub; ; //Create e new timetables
Offspring replaces s the e worst individuals s in n population; //Order on fitness,
//remove worst t X X in population,
//insert X offspring in population.
With a a small l chance, , do o an additional mutation; ; //E.g., swap subjects
GeneticAlgorithmsderivetheirnamefromthefactthattheyareinspiredbyDarwiniannatural
selectionmechanisms.Justlikeinreallife,geneticalgorithmsworkona‘population’of‘individu-
als’.
12
JPEG to PDF Converter | Convert JPEG to PDF, Convert PDF to JPEG
similar software; Support a batch conversion of JPG to PDF with amazingly high speed; Get a compressed PDF file after conversion; Support
advanced pdf to jpg converter; convert pdf images to jpg
JPG to JBIG2 Converter | Convert JPEG to JBIG2, Convert JBIG2 to
Image Converter Pro - JPEG to JBIG2 Converter. Convert JPEG (JPG) Images to, from JBIG2 Images on Windows.
batch convert pdf to jpg; pdf to jpg
ProjectingaGeneticAlgorithmontotheproblemoftimetablinginvolvessomechoicesthatneed
tobemade:
1. Howisanindividualinapopulationspecied?
2. Howisanindividualevaluated(morespecic,whatisthe‘tnessfunction’?)
3. Howareindividualsselected?
4. Howis‘ospring’constructedfromasetofindividuals?
5. Howareindividualsmutated?
1. Todeneanindividualitis s necessary torstexplainwhatwewanttodowiththewhole
population(asetofindividuals). Thegeneralideaisthis: Fromapopulationoftimetables(thus,
an‘individual’isacompletetimetable)select(see3)afewofthebest(see2)availabletimetables
(=individuals)andmutate(see5)themtocreate(afew)bettertimetables(see4). Thisprocessis
repeatedaxednumberoftimes,ormorelikelyuntilacertainpredeterminedthresholdofquality
hasbeenreached.
2. Tobeabletosayanythingaboutthequalityofageneratedtimetablethereneeds s tobea
waytoevaluateit.Thisiscalledthe‘Fitnessfunction’,thedigitalversionofthebiological‘Survival
oftheFittest’. Thecorrectconstructionofthetnessfunction(see6.4)iscrucialtotheproper
workingof the whole timetabling system! ! In n regardto the timetablingsystem one caninclude
positiveweightinthecaseatimetabledoesnothavemuch‘gaps’betweensubjects,hasalllectures
between 8:00 and16:00,andcaninclude negativeweight t to unwantedthings such h as s breach h of
(soft)constraints,many‘gaps’betweensubject,veryearlyorverylatelecturetimes,etcetera.
3. Fromthepopulationof f timetables, afew of the best areselected. . Theselection n process
canbedoneinafewdierentways. A‘selectionmethod’isusedtoselectwhichindividualsfrom
a populationare allowed to combinetheir ‘genetic code’ (their timetable structure) ) to o produce
new timetables s (‘ospring’, , a technique e called ‘crossover’), , thereby y hopefully producing better
individuals.Theobviousselectionmethodistosortthetimetablesinthepopulationdependingon
theirtnessandusetherstfewwiththehighesttness. This,however,cancausethealgorithm
togetstuckinacertaintypeoftimetable;Iftheselectedtimetablesallhave,forexample,‘Physics’
onMondaythersthour,thenitisverylikelythatallospringcreatedbycombiningtwoofthese
timetablesalsohas ‘Physics’onMondaytherst hour. . Thus,acertaindegreeofrandomnessin
theselectionprocessisneeded.
Ingeneraltherearethreeselectionprocesses:
Randomselection Simplyselectasetofcouplesofindividualsrandomlyandhavethemproduce
ospring.
Roulette wheel selection n Assignindividualsaportionofanimaginaryroulettewheelbasedon
theirtnessfunctionvalue. Thehigheraindividual’stness,thebiggerapartoftheroulette
wheelgetsassignedtoit,andthusthehighertheprobabilitythisindividualhastobeselected
forpropagation.
13
JPG to GIF Converter | Convert JPEG to GIF, Convert GIF to JPG
Converter. Convert JPEG (JPG) Images to, from GIF Images on Windows. JPEG to GIF Converter can directly convert GIF files to JPG files.
convert pdf photo to jpg; bulk pdf to jpg
JPG to DICOM Converter | Convert JPEG to DICOM, Convert DICOM to
Image Converter Pro - JPEG to DICOM Converter. Convert JPEG (JPG) Images to, from DICOM Images on Windows.
convert pdf into jpg online; convert multiple pdf to jpg
Tournamentselection Thisapproachworksbydividingthepopulationintoseveral,usuallyof
userdenedsize,subsets P
0
P. Outofeachsubset, , only y the best individual l p
0
2P
0
is
selectedforproducinganewgeneration.Eachsubsetcanthusbeseenaslittletournaments
wherethewinnertakesall,hence‘tournamentselection’.
Inour experience,theselectiondoes not have amajor impact on n the results. . The e dierent
strategieshoweverareveryeasytoimplementsocreatingallthreeshouldbenoproblem.
4.Generatingospring(=newtimetables)fromparents(=currenttimetablesinthepopulation)
needsastrategyon‘how’tocreatethese. Somepossiblestrategiesaredescribedbelow:
SingleSwitching Takeonetimetableandswitchafewsubjectsaround.
Double Switching g Selectafewsubjectsfromtimetable1andafew(other)subjectsfromtimetable2
andcombinetheseintoanewtimetable(andvice-versa;selectallothernon-selectedsubjects
fromtimetable1andthepreviouslynotselectedsubjectsfromtimetable2tocreateanother
newtimetable).
Reschedule Removeafewsubjectsfromatimetableandreschedule(putthemsomewhereelse)
inthesametimetable.
SwitchPeriods Takeatimetableandswitcharoundperiods(e.g.,switchMondaywithTuesday).
Foreachofthesestrategiesyoumustkeeptheconstraintsinmind!
5. Mutationisaprocesswhichonlyoccurssometimesinarunofthealgorithmonone(ora
few)timetable(s).Thechancethatitoccurscanbespeciedandcanbeanyvaluebetween10%to
50%.Amutationisjustthat:Achangeinatimetable.Anychangepossiblecanbeused;switcha
subject,removeasubject,changerooms,switchdays,andsoon. Mutationisusedtokeep‘fresh’
timetableswithinthepopulation.
6.3 LocalSearch
The local searchfamily y algorithms s concerns a large set t of f optimizationstrategies in Computer
Science.Itispopular,becauseithasthepotentialtoapproximateoptimalvaluesinalargesearch
spacesinareasonableamountoftime,bycomparingseveralobjectsinthesearchspacewitheach
other.
for each individual in population do
Perform individual learning; //Change all l timetables
end for
Whenapplyinglocalsearchyouwanttokeepinmindtheexploration/exploitationratio: Al-
readyconstructedtimetableswillgetbetterbecauseofthegeneticpartofthealgorithmandyou
14
want to takeadvantageof this (exploitation). . Onthe e other side youalso wanttocreateother,
bettertimetables,whichforcesyoutochangepartsofthetimetablewhichmight(ormightnot)be
agoodchoice(exploration).
 2-Opt:In2-Opt,anindividualgets‘sliced’inthemiddleandrecombinedsomeotherway.In
thelightoftimetablesthiscouldmeansplittingatimetableinthemiddle(mondaybecomes
thursday,tuesdaybecomes,friday,wednesdaystayswednesday),orsplittingitatsomeother
(possiblyrandompoint)toallowalldaystochange.
 Hillclimbing: : This s strategy is s basedona per r subject t basis: : Take e each subject as s they
appearinthetimetableandrescheduleit(withoutbreakinghardconstraints)inthetimeslot
whichgivesthehighesttnessvalue.Theideabehindthisstrategyisthatbyincreasingthe
tnessonapersubjectbasistheendresult(thetnessofthenewtimetable)willbebetter
too.
Whichstrategyischosenisleftuptothedevelopers,becauseitisimpossibletotellwhichstrategy
willworkbestwithouttrying.
6.4 FitnessFunction
Thequality ofany timetable isdeterminedbya ‘tnessfunction’. . Thisfunctionhastokeepin
mindthehardconstraints,softconstraints,andpossiblythepreferencesofindividualschools(See
Appendix7.1).Itisimportanttocreateagoodtnessfunctionbecausetheresultsofthealgorithm
dependhighlyonthisfunction. Thefunctionshouldbeabletogiveanindicationofthequalityof
atimetable,inashortperiodoftime. Speedofexecutionisveryimportant,becausethisfunction
willbecalledmanymanytimes.Aslowfunctionwillmakethewholemoduleextremelysluggish.
 HardConstraints:Thesearetheconstraintsthatshouldnotbebroken.Twotactics:Forbid
timetableswhichbreachtheseconstraints,orgiveahighpenaltywhentheseconstraintsare
broken,butstillallowthem. Thedecisionwhichofthesetwotacticsshouldbeusedhas s to
bemadeduringimplementation,afteranextensivetimeoftesting.
 SoftConstraints:Thesearetheconstraintsthatshouldrathernotbebroken. Timetables
breachingsoftconstraintsshouldreceiveapenalty.
 Preferences: : Thesearethepreferencesoftheindividualschools. . Timetableswhichfulll
thesepreferencesshouldgetrewarded.
Theheightofpenaltiesandrewardsshouldbedeterminedthroughexperimentation. Thereisa
choicebetweenchoosingeithera‘xed’valueforallpenalties/rewards,ora‘dynamic’valueforeach
individualconstraintorpreference.Twoexamplesofusingthisinatnessfunctionaregivenbelow.
Noteagainthatndingapropertnessfunctionisforalargepartbasedonexperimentation.Use
thesetwoexamplesasthenamesays;Examples.
15
H: Numberofhardconstraintsbroken.
S:Numberofsoftconstraintsbroken.
P: Numberofpreferencesfullled.
#h: Totalnumberofhardconstraints.
#s:Totalnumberofsoftconstraints.
fitness(x)=
H+S P
#h+#s
(2)
wherexisatimetable.
H[i]: Hardconstraintibroken.
S[i]:Softconstraintibroken.
P[i]: Preferenceifullled.
hp[i]:Penaltyforhardconstrainti.
sp[i]: Penaltyforsoftconstrainti.
r[i]: Rewardforpreferencei.
fitness(x)=
(H[i]hp[i])+(S[i]sp[i]) (P[i]r[i])
#h+#s
(3)
wherexisatimetable.
16
7 Appendix
7.1 IndividualSchoolRequirements
7.1.1 SchoolofMathematics
GeneralInformation:
TimetablegenerationwithExceltakesabout3weeksatthebeginningoftheterm.Thisschool
hasnoownrooms,sotheyusethefacilitiesoftheschooloftechnology. Ifthereisneedforadditional
roomsduringtheterm,ndinganavailableonetakesverylong. Lectureblocksof2hours,each
subject4-6hoursaweek. 1term=40hourspersubject. Theydon’tmaketheTTfor r therst
years(ascurriculumisthesameasotherschools)
Constraints:
 Noconstraintsspecied
Preferences:
 Examsofdicultsubjectsshouldbeinthemorning
 NolecturesonFriday
 Not2lecturesofdicultsubjectsaday,preferablyevenadaybetweenthem
 Examsshouldbesupervisedbylecturersfromownschool
7.1.2 SchoolofBusiness
GeneralInformation:
Theyhaveenough roomfor r alltheir lectures/students. . Currently y their timetableruns from
7:00to19:30(3breaks: 10:00-10:30,12:30-14:00,17:00-17:30). . Theyhaveaneveningprogram(2
semesters)whichrunsfrom17:30to20:40.Studentsregisterforeachsemester,rstsemesterstarts
inJanuary. Theyusehalfsubjects(only2hoursaweek),whilenormalsubjectshave4. . Subject
codeidentieshalfsubjectsbyendingwithanoddnumber.Theyhavedicultsubjectsidentied
bya highrateoffailureofstudents inthe exam. . There e isno problem withstudents repeating
subjects,asmostofthetimethesameteacherholdthefollowupsubject,thereforethereareno
overlaps.
Constraints:
 Lecturersarerequiredtobeoncampusfrom8-16
17
 Studentsshouldbeinroomsoftheirownschool.Whohaskeysforschoolrooms?Oneperson
perschool.
 NolecturesonFriday(lastyearstudentsneedtimeforproject)
 Onlyoneexamaday
 Prerequisitesubjectshavetobeconsidered
Preferences:
 Lecturersshouldbeabletospecifypreferredday/timeofday(morning/afternoon,evening)
 Possibilitytoexcludearoomfromthetimetablingprocess
 Examsupervisorshouldbeprovidedbytheschool
 Not2dicultsubjectsaday
 Themorestudents,theearliertheexamination(timeofday)
7.1.3 SchoolofTechnology
GeneralInformation:
Thisschooldoesnothaveenoughroomsforallitsstudents/lectures,soitborrowsroomsfrom
theschoolofnaturalresourcesiftheneedarises. Constraints:
 Prerequisitesubjectsmustbeconsideredandmaynotoverlapwiththeirfollowupsubjects
 Additionalattributeforthetypeofteacher. Professorsupervises2exams,Lecturer6.
 Therecanbe2examsaday,aslongastheyarenotbothdicultsubjects
 FinalyearstudentshavenolecturesonFriday(Timeforproject)
Preferences:
 Possibilitytoexcludearoomfromthetimetablingprocess
 Thereshouldnotbe2dicultsubjectsononeday
 Lecturersshouldbeabletospecifypreferredday/timeofday(morning/afternoon,evening)
18
Documents you may be interested
Documents you may be interested