EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
C/C++代写
您的位置: 主页 > 编程案例 > C/C++代写 >
代写C++/C:C语言代码代写Practical 6: Polymorphism and Complexity - C++代写
发布时间:2021-07-25 22:29:02浏览次数:
All submissions for the practical assignments should be under version control. Submission procedure remains the same with the first practical assignment.The directory under version control for this assignment should be named ashttps://version-control.adelaide.edu.au/svn/aXXXXXXX/2018/s1/adds/assignment6/where aXXXXXXX is your student ID.If you get stuck on one of the hidden test cases and really cannot resolve it yourself, please feel free to ask the practical tutors for hints.Weencourageyoutofinishyourworkbeforethepracticalsessionandtakethesessionas consultingtime.2ProblemDescription2.1ObjectiveThis practical will test your knowledge polymorphism and computational complexity analysis.2.2DesignInafilenameddesign.pdf,describehowyouaregoingtosolvetheproblemandtest your implementation with the test cases you designed based on the stagesbelow.Testing Hint: it’s easier if you test things as a small piece of code, rather than building a giant lump of code that doesn’t compile or run correctly. As part of your design, you should also sketch out how you are going to build and test the code.2.3ProblemDNA contains the genetic code that defines the structure of every organism on Earth. TheinformationinthisDNAiscopiedandinheritedacrossgenerationsfromindividual toindividual,butmaychangeovergenerationsduetocrossoverandmutation.Amoresuccessfulindividualismorelikelytosurvivetobreed,increasingthelikelihoodthatit willbeabletopassonitsparticularDNAencoding.Inthispractical,wearegoingtorepresentanindividualwithabinary“DNA”strandand mutateitoveranumberofgenerationstogetabetterqualityindividual.Theconceptsin thispracticalarerelatedtoEvolutionaryComputation,afieldofArtificialIntelligence.Evolutionarycomputationhasbeenusedtosolveanumberofproblems,includingmak- ing virtual creatures, reducing race time for athletes, designing strategies for satellite coverage,designingturbines thelistgoeson.Thefollowingarticlesprovidesomekind of overview on evolutionary algorithms. Please have a read if you areinterested.http://www.perlmonks.org/?node_id=298877http://www.genetic-programming.com/published/usnwr072798.html2.3.1Representation of binarystringsInthispractical,weuseaclasscalledIndividualtorepresenttheDNAwhichcanbe represented by a list of binary digits. Individual has a variable called binaryString which stores the value ofgenes.Your Individual class should at least have the following functions:string getString(): The function outputs a binary string representation of the bitstring list (e.g.“01010100”).int getBit(int pos): The function returns the bit value atpositionpos. It shouldreturn-1ifposisoutofbound..voidflipBit(intpos):Thefunctiontakesinthepositionofthecertainbitand flip the bitvalue.intgetMaxOnes():Thefunctionreturnsthelongestconsecutivesequenceof‘1’ digitsinthelist(e.g.callingthefunctionon“1001110”willobtain3).•int getLength(): The function returns the length of thelist.AconstructorthattakesinthelengthofthebinaryDNAandcreatesthethebinary string. Each binary value in the list should be given a value of 0 bydefault.A constructor that takes in a binary string and creates a new Individual with an identical list. Note that this involves creating a new copy of the list.2.4SmoothOperatorInordertomutatetheDNA,weneedaclasscalledMutator.TheMutatorclasshasa virtualfunctionmutatethattakesinanIndividualandanintegerindexkasparameter andreturnstheoffspringaftermutation.Youarealsorequiredtoderivestwoclassesfrom Mutator:BitFlip: The mutate function in this class “flips” the k-th binary digit. If k is greater than the length of the list, we will count in circles. For example, if the length of the list is 10 and k = 12, then the mutate function will flip the second digit.BitFlipProb:Themutatefunctioninthisclassgoesthrougheverydigitinthebi- narystringand“flips”eachofthebinarydigitwithprobabilityp.Theprobabilityp isoftypedoubleandintherangeof(0,1).pshouldbeinitializedintheconstructor.Rearrange:Inthisclass,themutatefunctionrearrangesthelist.Thefunctionwill select the k-th digit in the bitstring (again, counting in circles). This digit and all digits after it (all the way to the tail) will be moved to the start of the list. For example,ifyouwererearrangingthelist(a,b,c,d,e)andk=3,thefunctionwould returnanIndividualwiththelist(c,d,e,a,b).In your main.cpp, please add an ordinary functionIndividual* execute(Individual* indPtr, Mutator* mPtr, int k),whichcallsthemutatefunctionontheIndividualobjectandreturnstheoffspring. Yourexecutefunctionshoulddecideonwhichmutatortousebasedontheactualtype of theMutator.2.5ComplexityIn a separate file with name runtime.txt, write down the computational complexity of yourmutatefunctions.PleaseincludesomeanalysisprocessandtheBig-Ohnotationas a finalresult2.6MainfunctionThetestscriptwillcompileyourcodeusingg++-omain.out-std=c++11-O2-Wall*.cpp. Itisyourresponsibilitytoensurethatyourcodecompilesontheuniversitysystem.g++hastoomanyversions,sobeingabletocompileonyourlaptopdoesnotguaranteethat it compiles on the university system. You are encouraged to debug your code on a lab computer (or useSSH).You are asked to create a main function(main.cpp). Ittakesinonelineofinput.binarystr1 k1 binarystr2k2TwoIndividualobjectsshouldbecreatedusingbinarystr1andbinarystr2.TheBitFlip mutationandRearrangemutationareinvokedonthefirstandthesecondIndividualwithindexk1andk2respectivelythroughexecutefunction.Theoutputofyourmain functionshouldbethetworesultingbinarystringandthelongestconsecutivesequence of 1-bits of the second offspring. k1 and k2 are both positive integers. Please separate the results using onespace.Sample input: 000000 2 0111 2Sample output: 010000 1110 3Sample input: 001100 7 0111003Sample output: 101100 110001 23MarkingSchemeDeadline:10:00am4thMay.Nomarksforsubmissionslaterthan10:00am 7th ofMay.Your submission should contain at least design.pdf, main.cpp and other cpp filesand header files. The design document should be submitted in the first submission to the websubmissionsystem.This practical is worth 3% of your final mark. This practical assignment is marked out of 9.•Design (2marks):–UML diagram of central classes and explanation of core functions (1mark)–Details of your own test cases/schemes (1mark)•Style (2marks):–ProperusageofC++languageelementsandparadigm(1mark)–Commentsonnon-trivialcodeblocksandfunctions(1mark)•Functionality (2marks):–Passing public test cases (1mark)–Passing hidden test cases (1mark)•Complexity Analysis (3marks):–Runtimeanalysisofthethreemutatefunctions代写CS Finance|建模|代码|系统|报告|考试编程类:C代写,JAVA代写,数据库代写,WEB代写,Python代写,Matlab代写,GO语言,R代写金融类:统计,计量,风险投资,金融工程,R语言,Python语言,Matlab,建立模型,数据分析,数据处理服务类:Lab/Assignment/Project/Course/Qzui/Midterm/Final/Exam/Test帮助代写代考辅导天才写手,代写CS,代写finance,代写statistics,考试助攻E-mail:[email protected]微信:BadGeniuscs 工作时间:无休息工作日-早上8点到凌晨3点如果您用的手机请先保存二维码到手机里面,识别图中二维码。如果用电脑,直接掏出手机果断扫描。

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。