How anomic1911/mobile-phone-tracking-system works
Project Type and Purpose
• This project is a simulation/assignment that implements a mobile phone tracking system.
• Its primary purpose is to model a hierarchical call routing system where each mobile phone, registered with a base station, is tracked through a multi-level area exchange hierarchy. The system determines which base station a mobile phone is registered with during a call by traversing the routing map tree.
• The core functionality resides in managing the routing map data structure (implemented in the RoutingMapTree.java file) and the associated resident sets (such as MobilePhoneSet and possibly Myset) that maintain which mobile phones are registered with each exchange.
File Structure Analysis
• Although the project is not divided into separate directories, the naming of files hints at the logical components:
• RoutingMapTree.java: Likely the main class that manages the hierarchical tree structure representing area exchanges. It encapsulates the logic for tracking and querying mobile phone registrations from the root (central server’s perspective) down to individual base stations (leaf nodes).
• MobilePhone.java: Represents individual mobile phones in the simulation.
• MobilePhoneSet.java and Myset.java: These files likely implement set data structures used to store collections of mobile phones, such as resident sets at each exchange.
• ExchangeList.java: Possibly used to manage a list or grouping of exchanges, which may form part of the routing map.
• Additional files like checker.java, assn3checker.java, and several text files contain test data, answers, or instructions but don't change the core architecture.
• The presence of a PDF and various TXT files suggests that there might be assignment instructions or test scenarios that support the simulation process.
Key Components and Their Relationships
• Central Server (C): Envision this as the component that stores the entire Routing Map Tree. It is responsible for answering queries regarding mobile phone locations during phone calls.
• Routing Map Tree: This is a hierarchical data structure where:
• The root contains the resident set of all registered mobile phones.
• Internal nodes represent level i (or higher) area exchanges which consolidate the resident sets of their child exchanges.
• Leaves represent base stations (level 0 area exchanges) where phones are directly registered.
• Mobile Phone: Represents an individual entity that is registered with a base station.
• Base Stations: Modeled as leaf nodes in the RoutingMapTree where mobile phones are initially registered.
• Area Exchanges: Nodes in higher levels of the tree which group base stations together. They facilitate call routing by determining which subtree (or child node) can service a particular mobile phone registration request.
• Query Process: When a phone call is made, the originating base station communicates with the central server (C). The server traverses the tree (checking resident sets) to locate the correct base station for the target phone number and returns the routing path back to the caller’s base station.
Notable Architectural Patterns or Design Principles
• Hierarchical (Tree) Structure: The routing map is fundamentally a tree that relies on parent-child relationships. This pattern helps in efficiently narrowing down the location of a mobile phone.
• Separation of Concerns: The simulation separates the data structure (RoutingMapTree and supporting set classes) from the simulation logic (likely embedded in other files and test scenarios). Even though everything is in one directory, the naming conventions denote clear roles.
• Modular Data Structures: Custom set implementations (MobilePhoneSet and Myset) suggest a focus on modularity and encapsulated functionality.