@nishandahal/urban-mobility
v1.0.1
Published
This is a Node.js package designed to model and manage an urban mobility and smart transportation system. This package provides classes and methods to simulate passengers, vehicles, routes, scheduling, and fare calculation in a smart transportation networ
Downloads
1
Readme
Urban Mobility and Smart Transportation System
This is a Node.js package designed to model and manage an urban mobility and smart transportation system. This package provides classes and methods to simulate passengers, vehicles, routes, scheduling, and fare calculation in a smart transportation network.
Installation and Usage
Follow the steps below to install and test the package in your own project.
Step 1: Set Up Your Project
Create a new project folder.
Inside your project folder, create a new app.js file and copy the following code into it:
const { Passenger, Vehicle, Route, TransportationNetwork } = require('@nishandahal/urban-mobility'); const network = new TransportationNetwork("Smart Mobility Network"); const passenger1 = new Passenger("P001", "Alice"); const vehicle1 = new Vehicle("V001", "Bus", 2); const route1 = new Route("R001", "Downtown Loop"); route1.addVehicle(vehicle1); network.addRoute(route1); network.registerPassengerToVehicle(passenger1, vehicle1, route1, 5); console.log("Urban Mobility System Executed Successfully!"); step 2:initialize your project in terminal run npm init -y step 3: install the package in terminal npm install "@nishandahal/urban-mobility" step 4: run application node app.js