AIM Project 2020 – Implementation of a HyFlex Compatible Postal Worker Problem (PWP) Domain
1 INTRODUCTION
The Postal Worker Problem (PWP) is a routing-type problem which states that given N number of postal deliveries, a post office depot, and the postal workers home address, the objective is to find a route which ensures that all postal deliveries are made exactly once such that the total tour length is minimised whereby the postal worker starts their shift at the start of the day at the post office depot, and finishes their day by returning to their home address once all deliveries have been made.
HyFlex is a software framework designed for the implementation and testing of iterative general- purpose search methods and will be/was covered in the “HyFlex Tutorial Lab” (13/03/2020).
2 OBJECTIVES
The aim of this project is to implement a HyFlex compatible PWP problem domain. A template code base is given to you to give you a starting point. You may wish to add more classes in your implementation; this is fine if each of the supplied classes and methods function as described in their requirements. There are several components which you must implement, some of which can be accomplished multiple ways with the hardest attracting more marks as detailed in each section. These will be highlighted in this document in green to highlight these areas. Below you will find a breakdown of each of these components along with a description of what you are expected to implement.
3 DEADLINE AND MARKS
You should submit a single zip folder containing all your source files, any libraries used, and the instance files – that is, so that we can run it without any compilation errors caused by missing files!
This project consists of an implementation, and a 2,000-word report with a maximum 4-page limit (using 11pt font!). The weightings for each are 80% implementation and 20% report.
PWP DOMAIN COMPONENTS
PROBLEM REPRESENTATION
You are to use a permutation representation using an array of integers (int[]) for representing solutions to the PWP problem instances such that each integer corresponds to an individual postal delivery whose mapping is specified by the order each delivery address appears in the instance file(s).
INSTANCE READER
Problem instances are stored as *.pwp files and reside in the folder “instances/pwp/*.pwp”. To be able to “load” an instance using HyFlex’s problem.loadInstance(int id) method, you should fulfil two components:
PWPInstanceReader
loadInstance(int id)
PWPInstanceReader
You should implement the readPWPInstance method in the PWPInstanceReader class to read in an instance from a given file, returning a new PWPInstance Object. Each PWP instance file is a plain text written in accordance to the following structure where the structure is in bold, and data italic:
The readPWPInstance method should return an instance of a PWPInstance Object which contains all the information relating to the problem instance. Moreover, it contains a factory method to create solutions to the current problem instance given an InitialisationMode. As discussed in Section 4.3, you only need to implement random initialisation.
To create a PWPInstance, five components are required: the t otal number of locations, an array of Locations, the Location of the post office depot, the Location of the worker’s home address, and a seeded random number generator.
The number of locations can be calculated from the problem instance
Each Location object is essentially a wrapper for an x and y coordinate and should be populated depending on the information from the problem instance file specified by the Path supplied to the readPWPInstance
The random number generator is passed as an argument to the readPWPInstance
loadInstance(int id)
This method should map instance IDs as integers to each of the problem instances stored in the “instances/pwp/*.pwp” folder. Once the respective instance is located, it should use the PWPInstanceReader class to load the instance information as a PWPInstance Object.
At this point, it is a good idea to set the objective function to be used by each of the heuristics.
SOLUTION INITIALISATION
The order of postal delivery addresses should be chosen at random (dependent on a seeded random number generator).
OBJECTIVE FUNCTION
To evaluate the cost of a solution, you should calculate the total distance of the postal workers journey starting at the postal depot and ending at their home. Distances between two locations should be calculated as their Euclidean distance. That is, in the below example, the total distance should be calculated using both sets of green and yellow routes.
Figure 1 - Sample solution illustrating the postal worker's delivery route and return journey.
Standard Evaluation
This is the easiest evaluator to implement. A standard evaluator takes the current solution and calculates the sum of distances between each location, setting the objective function value of the solution once the entire calculation is complete using the method below.
PWPSolution.setObjectiveFunctionValue(double objectiveFunctionValue);
4.4.1 Delta Evaluation
This is more complicated than the standard evaluation technique but is much faster and will attract more marks (if implemented correctly!). Delta evaluation exploits the fact that if a segment of a route is not changed, then neither will the distance of that route segment. Hence, only the path between locations that are removed and created need to be calculated. Beware of the trips between the postal office and worker’s home locations with the start and end points of the explicitly represented route!
Each time a heuristic is applied to a solution, its objective value must be updated during the application of the heuristic. By subtracting the removed part(s) of the tour from the current objective function value, and adding back the newly created part(s) of the tour using the methods:
50 Answers
62 Answers
DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Functions and Arrays – to solve computationalproblems.Arrays provide a convenient way to store &
The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is anPath finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going through certain obstacles. As the main aim is to thinkabout path finding, we focus on the common task
Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individualDevelop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. TheLineItem class will represent an individual line item of merchandise that acustomer is purchasing.
SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define: SeaPortProgram e
Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define: SeaPortProgram e
The first programming project involves writing a program that parses, using recursive descent, a GUI definition language defined in an input file and generates the GUI that it defines. The grammar for this language is defined below:1Project 1The first programming project involves writing a program that parses, using recursive descent, a GUIdefinition language defined in an input file and generates the GUI that it defines. The grammar for thislanguage is defined below:gui ::= Wi
CMSC 335 Project SeaPort Solved Project 3 Introduction the SeaPort Project series For this set of projects for the course we wish to simulate some of the aspects of a number of Sea PortsCMSC 335 Project SolvedProject 3 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:
CMSC 335 Project 4 Solved SeaPort Introduction the SeaPort Project series For this set of projects for the course we wish to simulate some of the aspects of a number of Sea Ports Here are the classes and their instance variables we wish to defineProject 4 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define: SeaPortProgram ext
CMSC 451 Project 2 Solved The second project involves completing and extending the C++ program that evaluates statements of an expression language contained in the module 3 case studyProject 2 The second project involves completing and extending the C++ program that evaluates statements of an expression language contained in the module 3 case study. The statements of that expression language consist of an arithmetic expression f
CMSC 451 Project 1 Solved The first project involves benchmarking the behavior of Java implementations of one of the following sorting algorithms bubble sort selection sort insertion sort Shell sort, merge sort quick sort or heap sortCMSC 451 Project 1The first project involves benchmarking the behavior of Java implementations of one of thefollowing sorting algorithms, bubble sort, selection sort, insertion sort, Shell sort, merge sort,quick sort or heap sort. You must post your
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.
Get Free Quote!
250 Experts Online