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

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

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

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

EG1hao
网课代修代上,cs代写代考
C语言代写
您的位置: 主页 > 编程案例 > C语言代写 >
代写C语言:CS代写之use Python, Java, C, C++ or MATLAB 实现代做The 3-digit puzz - C语言代写
发布时间:2021-07-25 14:22:55浏览次数:
This assignment is worth 10% of your final mark. It is an individual assignment; no group work.Late submissions policyNo late submissions are allowed.Programming languagesYourimplementationcanbewritteninPython,Java,C,C++orMATLAB.Theassignmentwillbetested usingthelanguageversionsasdescribedinthe“Howyourprogramwillberun”sectionbelow,soitis important that your program can be run in the specifiedversions.SubmissionYour assignment must be completed individually using the submission tool PASTA (https://comp3308.it.usyd.edu.au/PASTA). In order to connect to the website, you’ll need to be connectedtotheuniversityVPN.YoucanreadthispagetofindouthowtoconnecttotheVPN.PASTA will allow you to make as many submissions as you wish, and each submission will provide you with feedback on each of the components of the assignment. You last submission before the assignment deadlinewillbemarked,andthemarkdisplayedonPASTAwillbethefinalmarkforyourassignment.1.The 3-digitpuzzleIn this assignment, you will implement a number of search algorithms to solve the 3-digit puzzle. Given are two 3-digit numbers calledS(start) andG(goal) and also a set of 3-digit numbers called1.You cannot add to the digit 9 or subtract from the digit0;2.You cannot make a move that transforms the current number into one of the forbidden numbers;3.You cannot change the same digit twice in two successivemoves.Note that since the numbers have 3 digits, at the beginning there are at most 6 possible moves from. After the first move, the branching factor is at most 4, due to the constraints on the moves and especially due to constraint 3.For the purpose of this assignment numbers starting with 0, e.g. 018, are considered 3-digit numbers.2.Tasks1.Write a program to find a solution of the puzzle using the following 6 search strategies: BFS, DFS, IDS, Greedy, A* and Hill-climbing. Use the Manhattan heuristic as a heuristic for A* and Greedy and also as the evaluation function inHill-climbing.TheManhattanheuristicforamovebetweentwonumbersAandBisthesumoftheabsolute differences of the corresponding digits of these numbers, e.g.ℎ(123, 492) = |1 − 4| + |2 − 9| + |3 − 2| =11.2.Avoidcycles.Whenselectinganodefromthefringeforexpansion,ifithasn’tbeenexpanded yet,expandit,otherwisediscardit.Hint:Itisnotjustthethreedigitsthatyouneedtoconsider whendeterminingifyouhaveexpandedanodebefore.Twonodesarethesameifa)theyhave the same 3 digits; and b) they have the same ‘child’nodes.3.Generate the children in the followingorder:a.1 is subtracted from the firstdigitb.1 is added to the firstdigitc.1 is subtracted from the seconddigitd.1 is added to the seconddigite.1 is subtracted from the thirddigitf.1 is added to the thirddigitExample:theorderofthechildrenofnode678comingfromparent668is578,778,677,679. Note that there are no children for the second digit as it already has been changed in the previous move (constraint3).4.For the heuristic search strategies: if there are nodes with the same priority for expansion, expand the last addednode.5.Set a limit of 1000 expanded nodes maximum, and when it is reached, stop the search and printamessagethatthelimithasbeenreached(seesection“InputandOutput”fortheexact messagerequired).3.Input andOutputAs your program will be automatically tested, it is important that you adhere to these strict rules for program input and output.InputYour program should be called ThreeDigits, and will be run from the command line with the following arguments:1.Asingleletterrepresentingthealgorithmtosearchwith,outofBforBFS,DforDFS,IforIDS, G for Greedy, A for A*, H forHill-climbing.2.A filename of a file to open for the search details. This file will contain thefollowing:start-stategoal-stateforbidden1,forbidden2,forbidden3,…,forbiddenN(optional)For example,thefilemight contain thefollowing:345355,445,554This file means that the search algorithm will start at state 345, and the goal is state 555. The search may not pass through any of 355, 445 or 554. Remember that the last line may not be present; i.e. there are no forbidden values.The following examples show how the program would be run for each of the submission languages, assuming we want to run the A* search algorithm, and the input is in a file calledsample.txt.Python (version 3.5.3):pythonThreeDigits.pyAsample.txtJava (version 1.8):javacThreeDigits.javajavaThreeDigitsAsample.txtC(gccversion6.3.0):gcc–lm-w-std=c99–oThreeDigitsThreeDigits.c*.c./ThreeDigitsAsample.txtC++ (gcc version 6.3.0):g++–oThreeDigitsThreeDigits.cpp./ThreeDigitsAsample.txtMATLAB (version R2017b):mcc-m-oThreeDigits-R-nodisplay-R-nojvmThreeDigits./run_ThreeDigits.sh MATLAB_install_directory Asample.txtNote:MATLABmustberunthisway(compiledfirst)tospeedupMATLABrunningsubmissions. The arguments are passedtoyourfunction as strings.Forexample, the example above will be executed as a function call like this:OutputYou program will outputtwo lines only. The first line will contain the solution path found from the start node to the goal node (inclusive), in the form of states separated by commas. If no path can be found with the given parameters, then the first line should be “No solution found.”.The second line should be the order of nodes expanded during the search process, in the form of states separated by commas. If no path was found, this should still print the list of expanded nodes. Remember that this list should never exceed 1000 states (point 5 in the Tasks section).ExamplesNote that the outputs of BFS and IDS here are quite long, and so the second line has wrapped. These outputs are still only two lines.

所有的编程代写范围: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++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。