Mountain Climber Project in Python

Job ID: 37226448

Budget: $30 – $250 AUD

Mountain Trail Representation
Create a representation of a mountain trail with interconnected mountains.

Plot View for Longest Trails
Develop a plot view that displays the longest trails suitable for a given hiker.

Trip Organizer
Implement a trip organizer that keeps track of the relative ranking of trips based on mountain difficulty.

What is a Trail?

In this app, a trail is a route over and between mountains. Trails can be as simple as a line with no mountain or as complex as a line with several mountains. You can combine trails in parallel (branching paths) or in series (one after the other). All possible trails are created by combining trails according to these rules.

Trail Creation & Edit Methods

Your first task is to enhance the Trail definitions in trail.py by adding methods to support editing trails. These methods should allow you to add and remove elements from the trail without altering the existing trail. Instead, they should create new Trail objects representing the edited trail. Implement methods like remove_branch, remove_mountain, add_mountain_before, add_empty_branch_before, add_mountain_after, and add_empty_branch_after as specified in the task description.

Traversing Trails with Terrific Tricks

Next, in the same trail.py file, implement the follow_path method. This method allows you to traverse a trail using a WalkerPersonality, a class with two methods: add_mountain and select_branch. You must implement follow_path without using recursion, and it should call add_mountain for every mountain on the trail according to the selected personality.

Double Keyed Table

Now, shift your focus to double_key_table.py and implement a Double Key Table data structure, which is like a hash table with two keys. It uses linear probing to resolve collisions and consists of a top-level hash table and internal hash tables. Implement methods like __init__, _linear_probe, keys, values, iter_keys, iter_values, __getitem__, __setitem__, __delitem__, table_size, and more. Ensure that the table resizes when the load factor exceeds 0.5.

Infinite Depth Hash Table

In infinite_hash_table.py, implement an Infinite Depth Hash Table data structure. This structure uses a hash function that depends on both the key and the hierarchy level. It resolves collisions by creating new hash tables at different levels. Implement methods like __init__, __getitem__, __setitem__, __delitem__, get_location, and sort_keys. Ensure that the table collapses to a single entry if only one pair remains in a table.

Mountain Organiser

Moving to mountain_organiser.py, implement the MountainOrganiser class. This class keeps track of mountains climbed by hikers and ranks them based on difficulty, with lexicographical ordering for mountains with the same difficulty. Implement methods such as __init__, add_mountains, and cur_position. This class should efficiently rank mountains as they are added, considering their difficulty and names.

Mountain Manager

In mountain_manager.py, implement the MountainManager class, which serves as a store for all mountains in a trail. It allows you to add, remove, and edit mountains, as well as filter mountains by difficulty and generate lists grouped by difficulty. Implement methods such as __init__, add_mountain, remove_mountain, edit_mountain, mountains_with_difficulty, and group_by_difficulty.

More Trail Methods

In your final task, continue working on trail.py. Implement the collect_all_mountains method, which returns a list of all mountains contained within a trail. Additionally, implement the difficulty_maximum_paths method, which calculates paths through the trail based on a specified maximum difficulty. These methods should provide valuable insights into the trails, allowing you to collect mountains and paths efficiently.
Related categories: Python Algorithm Data Analysis