Skip to content

TODO: Change TSPLibTour class #1

Open
@jkinable

Description

@jkinable

Currently, the TSPLibTour class (tspLibReader package) which models a tsp lib tour is not very practical in use:
-Tours need to be added and accessed via the TSPLib instance
-Tours don't keep track of their length. To get the length of a tour, one needs to invoke tspLibTour.distance(tspLibInstance); which recomputes the length of the tour with respect to the given TSPLib instance.

Proposed changes:
-Separate TSPLibInstance and TSPLibTour classes, thereby making them independent:
--Move the code which reads/parses a TSPLibTour from the TSPLibInstance to the TSPLibTour class
--Add a field to TSPLibTour which stores the length of the tour
--Remove the addTour() method from TSPLibInstance; this doesn't really make much sense
Note: These changes have implications for the other classes in the tspLibReader package. This has to be checked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions