ee4e,m.sc. c++ programming assignment introduction

13
EE4E,M.Sc. C++ Programming Assignment Assignment Introduction Introduction

Upload: joanna-stone

Post on 27-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: EE4E,M.Sc. C++ Programming Assignment Introduction

EE4E,M.Sc. C++ Programming

Assignment IntroductionAssignment Introduction

Page 2: EE4E,M.Sc. C++ Programming Assignment Introduction

Assignment Introduction Aims/ObjectivesAims/Objectives

To produce a C++ implementation of the To produce a C++ implementation of the ANT colony optimisation algorithm ANT colony optimisation algorithm (ACO) (ACO)

To apply to the travelling salesman To apply to the travelling salesman problemproblem

Page 3: EE4E,M.Sc. C++ Programming Assignment Introduction

ANT algorithms

Page 4: EE4E,M.Sc. C++ Programming Assignment Introduction

ANT algorithms

Ants are practically blind but they still Ants are practically blind but they still manage to find their way to and from food. manage to find their way to and from food. How do they do it?How do they do it?

These observations inspired a new type of These observations inspired a new type of algorithm called algorithm called ant algorithmsant algorithms (or ant (or ant systems)systems)

These algorithms are very new (Dorigo, These algorithms are very new (Dorigo, 1996) and is still very much a research area1996) and is still very much a research area

Page 5: EE4E,M.Sc. C++ Programming Assignment Introduction

ANT algorithms

Ant systems are a population based Ant systems are a population based approach. In this respect it is similar to approach. In this respect it is similar to genetic algorithmsgenetic algorithms

There is a population of ants, with each ant There is a population of ants, with each ant finding a solution and then communicating finding a solution and then communicating with the other antswith the other ants

Page 6: EE4E,M.Sc. C++ Programming Assignment Introduction

ANT algorithms Real ants can find the shortest path to a food source by Real ants can find the shortest path to a food source by

laying a pheromone traillaying a pheromone trail

The ants which take the shortest path, lay the largest The ants which take the shortest path, lay the largest amount of pheromone per unit timeamount of pheromone per unit time

Positive feedback reinforces this behaviour and more Positive feedback reinforces this behaviour and more ants take the shortest path resulting in more ants take the shortest path resulting in more pheromone being laidpheromone being laid

Page 7: EE4E,M.Sc. C++ Programming Assignment Introduction

Travelling Salesman Problem

Classic discrete optimisation problemClassic discrete optimisation problem Salesman needs to visit all cities just Salesman needs to visit all cities just

once and return back homeonce and return back home

Page 8: EE4E,M.Sc. C++ Programming Assignment Introduction

Travelling Salesman Problem

N cities -> (N-1)! routesN cities -> (N-1)! routes Currently TSP’s involving 1000’s cities are Currently TSP’s involving 1000’s cities are

being studiedbeing studied You should restrict your algorithm to You should restrict your algorithm to

problems with <100 cities!problems with <100 cities! The ACO algorithm has proved to be an The ACO algorithm has proved to be an

effective approach with performances close effective approach with performances close to optimalto optimal

Page 9: EE4E,M.Sc. C++ Programming Assignment Introduction

Travelling Salesman Problem

Ants distribute an amount of pheremone on each Ants distribute an amount of pheremone on each part of its route in inverse proportion to the length part of its route in inverse proportion to the length of the routeof the route Doesn’t quite mimic the behaviour of real ants!Doesn’t quite mimic the behaviour of real ants!

Typically the number of ants Typically the number of ants ~number of cities~number of cities After every iteration t (all ants complete their After every iteration t (all ants complete their

routes), the pheremone trails are updated and new routes), the pheremone trails are updated and new ants are generatedants are generated

Page 10: EE4E,M.Sc. C++ Programming Assignment Introduction

Travelling Salesman Problem

In practice, applying ACO to TSP is a In practice, applying ACO to TSP is a compromise between reinforcing previous compromise between reinforcing previous ant behaviour and exploring new solutionsant behaviour and exploring new solutions Probabilistic decisionsProbabilistic decisions Pheromone evaporationPheromone evaporation

Page 11: EE4E,M.Sc. C++ Programming Assignment Introduction

Implementation

Use any convenient programming platformUse any convenient programming platform Think about presentation of results and user Think about presentation of results and user

interfacesinterfaces Console based I/O ok but GUI’s more Console based I/O ok but GUI’s more

flexible and user friendlyflexible and user friendly Important to separate out ANT-based Important to separate out ANT-based

classes and the problem domain (TSP) classes and the problem domain (TSP) classes so that either can be used separatelyclasses so that either can be used separately

Page 12: EE4E,M.Sc. C++ Programming Assignment Introduction

Assessment

Programming report (deadlines are on the Programming report (deadlines are on the handout)handout)

Follow closely the marking pro-formaFollow closely the marking pro-forma The report should contain discussions about object The report should contain discussions about object

orientation, code re-useability, object interaction, orientation, code re-useability, object interaction, algorithm performance and comparisons (close to algorithm performance and comparisons (close to ‘optimal’?)‘optimal’?)

A formal design discussion is not expected but A formal design discussion is not expected but informal class/object diagrams and pseudo-code informal class/object diagrams and pseudo-code should be usedshould be used

Page 13: EE4E,M.Sc. C++ Programming Assignment Introduction

Assessment

Include with your report your software with Include with your report your software with enough information to allow me to run itenough information to allow me to run it Maybe include a user guideMaybe include a user guide

I will base the marks partly on the observed I will base the marks partly on the observed functionalityfunctionality