Skip to content

GregShiner/trains

Repository files navigation

Subway System Simulator

This is a brief description of your project.

Installation

To install the necessary packages, you need to have Python and pip installed on your system. If you don't have them, you can download Python here and pip will be installed with it.

Virtual env (optional)

If you would like to ensure that your dependencies remain isolated, it is recommended to setup a virtual environment.

To set up a virtual environment for your project, follow these steps:

  1. Open a terminal or command prompt.

  2. Navigate to the root directory of your project.

  3. Run the following command to create a virtual environment:

    python -m venv venv
  4. Activate the virtual environment:

    • On Windows:

      venv\Scripts\activate
    • On macOS and Linux:

      source venv/bin/activate

Make sure the project is activated before continuing to the next step.

Remember to always activate the virtual environment before working on your project to ensure that you're using the correct dependencies.

Install dependencies

Once you have Python and pip, you can install the required packages using the following command:

pip install -r requirements.txt

Usage

Run the program with the following command:

python main.py

Specifying Start and End Stations from the CLI

Running the program with no command line arguments will result in the user being prompted to select the start and end stations using fuzzy search. Start and end stations can be defined with the following command line arguments:

# Select only start station (end station will be prompted with fuzzy search)
python main.py --start "<start station name>"
# Select only end station (start station will be prompted with fuzzy search)
python main.py --end "<end station name>"
# Select both start and end station
python main.py --start "<start station name>" --end "<end station name>"

Specifying input file

The default subway layout file is the manhattan.json file. If you would like to use a different one (such as the small_example.json file provided) you can use the --input command line argument

python main.py --input small_example.json

If a station name(s) or the input file provided as command line arguments do not exist, the program will exit early.

About

Group project for CMPSC 462

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published