Genetic Algorithm Toolbox FAQ
Genetic Algorithm Toolbox FAQ
GeneticAlgorithmToolboxFAQ
CODeM
Home
Research
Publications
Projects
Software
Overview
Events
People
COMPLEXOPTIMIZATIONANDDECISIONMAKING
LABORATORY
AvailableSoftware
GAToolbox
FAQ
Download
Liger
GeneticAlgorithmToolboxFAQ
GeneralQuestions
WherecanIfindinformationabouttheGAToolbox?
Here.
Whatversion(s)ofMATLABdoestheGAToolboxworkwith?
TheGAToolboxwaswrittenforMATLABv4.2.Itisusablewithallsubsequentreleases
ofMATLAB,buttherearesomeminorsyntaxissuesthathavetobefixedbyhandwhen
usingtheToolboxwithMATLABv5.3andabove.
DoyouhaveaversionoftheGAToolboxsuitableforMATLAB567/available?
TheGAToolboxwasoriginallywrittenforMATLABv4.2,anditisthisversionofthe
Toolboxwhichwemakeavailablefordownload.ThisversionoftheToolboxcanbe(and
hasbeen)successfullyusedwithanylaterreleaseofMATLAB,but,dependingonthe
actualreleaseofMATLABbeingused,someminorsyntaxfixesmayneedtobeapplied
totheToolboxMfilesbyhand.Inthefuture,wemaymakeavailableversionsoftheGA
Toolboxwhichhavetherelevantcorrectionsappliedforthevariousreleasesof
MATLAB,butthesearenotyetavailable.
DoyouhaveaMOGAversionoftheGAToolboxavailable?
No.But,inthefuture,wemaymakesuchaversionoftheGAToolboxavailable.
http://codem.group.shef.ac.uk/index.php/gatoolbox/qafaq
1/4
30/07/2015
GeneticAlgorithmToolboxFAQ
HowdoIusetheGAToolboxtosolvemyparticularproblem?
WhilstwehappilymaketheGAToolboxavailableforfreedownloadandarealways
interestedtohearofyourexperiencesinusingit,wedonothavetheresourcestooffera
generalGAconsultingservice.Sowewillnotreplytoemailsenttousaskingforadvice
inusingthetoolboxtosolveparticularproblems.WeencourageallusersoftheGA
Toolboxtoreadcarefullytheaccompanyingdocumentationandtutorialexamples.For
general'howdoI?questions,wesuggestyoupostaquestiontotherelevantUsenet
groupcomp.ai.genetic.
HowcanIcontacttheauthorsoftheGAToolbox?
TheauthorsoftheGAToolboxcanbecontactedbysendinganemail.Weencourageyou
tosendusemailabouterrorsyouencounterwhenusingtheGAToolbox,aswellas
requestsforenhancementtothetoolbox,andgeneralcommentsaboutyourexperiences
withit.PleasereadthisFAQcarefullybeforesendinganysuchemail.
InstallationQuestions
HowdoIinstalltheGAToolbox?
WeadviseyoutoignoreanypurportedhighlevelinstallationhelpfromMATLABitself
and,instead,toinstallthetoolboxbyhand.Ifyouhaveacompletelylocalcopyof
MATLABonaPC,thenthisshouldn'tbeaproblemifyou'reusinganetworkedversion
ofMATLAB,thenyoumayhavetogetthesystemadministratortodothisprocessonthe
serveralternatively,youcanusethetoolboxfileslocallyfromyourownfilestore.
Thedetailsgosomethinglikethis:
1. IfyouhaveacompletelylocalcopyofMATLABonyourPC:
1. UnziptheGAToolboxsomewhereinyourownfilestore.(Hopefullyyouwillhavea
foldercontainingsomemfilesandsubfolders'DOCand'test_fns)
2. Renamethisfolder'geneticandmoveitintoyourC:atlab_nntoolboxfolder(The'nn
hereiswhateveryourMATLABversionnumberis.)
3. GotoyourC:atlab_nntoolboxlocaldirectoryandlocatethefile'pathdef.m.Takeacopy
ofthefileforabackup,thenopenthefilewithatexteditor.Youwillseethatitspecifies
thepathstoallthetoolboxesyouhave.ToaddtheGAtoolboxtothepath,addthetwo
lines:
>matlabroot,'\toolbox\genetic;',...
>matlabroot,'\toolbox\genetic\test_fns;',...
1.
1. That'sit:ifyourestartMATLABshouldhaveaccesstotheGAtoolbox.Alternativeto
theabovestepsa,b,c,distounzipthetoolboxtoaplaceofyourchoosing,andthenuse
MATLAB'ssetpathand/oraddpathfunctionstoaddthenewlyunzippedfolderand
subfolderstoMATLAB'ssearchpath.
2. IfyouareusinganetworkedcopyofMATLAB,theneither:
1. Thesystemadministratorshoulddothesameastheaboveforthesysteminstallationof
MATLAB,
http://codem.group.shef.ac.uk/index.php/gatoolbox/qafaq
2/4
30/07/2015
GeneticAlgorithmToolboxFAQ
2. Or,youcanusethetoolboxlocally,inthisway:
1. UnziptheGAToolboxsomewhereinyourownfilestore:(Hopefullyyouwillhave
afoldercontainingsomemfilesandsubfolders'DOCand'test_fns)
2. Renamethefolderto'genetic.Youmightalsowanttomoveitsomewhereelse.
Let'ssayitendsupind:workmatlabtoolboxesgenetic.
3. Addthetwolines
>path(path,'d:\work\matlab\toolboxes\genetic');
>path(path,'d:\work\matlab\toolboxes\genetic\test_fns');
tothefile'startup.minyourworkingdirectory.Yourworkingdirisgoingtobesomethinglike
'c:matlabnnworkforamodernPCinstallationofMATLAByoumighthavetocreatethefile
'startup.mthereifitdoesn'talreadyexist.
Again,that'sit.WhenyourestartMATLAByoushouldthenseetheGAtoolbox.
Alternativetotheabovestepsistounzipthetoolboxtoaplaceofyourchoosing,andthenuse
MATLAB'ssetpathand/oraddpathfunctionstoaddthenewlyunzippedfolderandsubfoldersto
MATLAB'ssearchpath.
Notethattheprocessdescribedaboveisthesamethingyou'ddotouseyourownMscripts:atthis
level,thereisnothingsignificantaboutthefactthattheGAscriptsarea'toolboxtheyarejusta
collectionofMscripts,andtheonlyissueisgettingtheirlocationmappedintotheMATLABpath
searchpath.TofindoutmoreabouttheMATLABsearchpathandrelatedmattersthen,forastart,
type'helppathattheMATLABprompt.
RuntimeQuestions
'WhydoIgettheerrormessage(s):identifierexpected,switchfound,orIllegaluseof
reservedkeywordswitch
Thiserrormessagemaybeencounteredwhenusingthe'objfun1function,forexample,
andreflectsoneofthesyntacticaldifferencesbetweenMATLAB6andpreviousreleases
ofMATLAB.Theactualerrormessageyouseemaydependontheactualreleaseof
MATLAByouareusing.TheGAtoolboxwasdevelopedforMATLABv4.2,andshould
alsoworkunchangedforMATLABreleasesuptoincludingv5.2.Forlaterreleasesof
MATLAB,someminorsyntaxfixesmayhavetobeappliedtotheMfilesofthetoolbox
byhand.ThesefixesshouldgenerallybeobvioustoanexperienceduserofMATLAB.In
thiscase,theproblemisthat,inMATLABv6,'switchisareservedword:inprevious
versionsofMATLABitwasnot.Tofixtheproblem,edittherelevantMfiletochange
allreferenceto'switchtosomethingelselike(eg'myswitch)instead.
'WhydoIgettheerrormessage(s):???UndefinedfunctionorvariableNonLin,orWarning:
ReferencetouninitializedvariableNonLin
TheactualerrormessageyouseemaydependontheactualreleaseofMATLAByouare
using.TheGAtoolboxwasdevelopedforMATLABv4.2,andshouldalsowork
unchangedforMATLABreleasesuptoincludingv5.2.ForlaterreleasesofMATLAB,
someminorsyntaxfixesmayhavetobeappliedtotheMfilesofthetoolboxbyhand.
ThesefixesshouldgenerallybeobvioustoanexperienceduserofMATLAB.Inthis
case,theproblemisthatthebehaviourofMATLABwithrespecttouninitialized
http://codem.group.shef.ac.uk/index.php/gatoolbox/qafaq
3/4
30/07/2015
GeneticAlgorithmToolboxFAQ
variablesdiffersbetweenMATLABreleases.PleaseseeTheMathworksTechnical
Solutionnoteonthisissue,namely:http:www.mathworks.comsupportsolutionsdata1
18GTU.htmlandthenapplyasuitablecorrectiontotherelevantMfile(s)oftheGA
Toolbox.
'WhyisthefunctionspecifichelpnotworkingfortheGAToolboxfunctions?
Wehavehadunconfirmedreportsthat,whenusedwithcertainreleasesofMATLAB,
functionspecifichelpfortheGAToolbox(eg'helpmutate)doesnotworkasexpected.
ForMATLABMfiles,functionspecifichelpinformationisencodedincommentswithin
theMfilesthemselves.Itmaybethatthedetailoftheallowablelayoutsofthese
commentsdiffersbetweensomeofthereleasesofMATLAB.Ifyoufindthatfunction
specifichelpisnotworkingforyou,pleasecheckthedocumentationforyourreleaseof
MATLAB,andcomparethedetailedrequirementsforthe'helpcommentswiththe
formatusedintheMfilesoftheGAToolbox.Inaddition,ifyoudohavethisproblem,
pleaseemailgatoolbox@sheffield.ac.ukwiththedetailsofyourversionofMATLABso
thatwecanupdatethisFAQ.TheworkaroundforfunctionspecifichelpforGAToolbox
functionsnotworkingfromtheMATLABcommandlineissimplytoreadthehelp
informationcontainedwithintherelevantMfilesusinganytexteditor.
Pagegenerated2013022521:32:44GMT,byjemdoc.
Moreinthiscategory: OverviewofPopulationBasedOptimizationAlgorithms
AlgorithmsToolbox
Genetic
backtotop
Backtotop
Copyright2013ComplexOptimizationandDecisionMakingLaboratory(CODeM).AllRights
Reserved.
http://codem.group.shef.ac.uk/index.php/gatoolbox/qafaq
4/4