osurs  0.0.1
Functions
cli.c File Reference

Command line interface for converting transit schedules and printing networks. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "osurs/io.h"
Include dependency graph for cli.c:

Functions

int convert_schedule (const char *schedule_file, const char *vehicle_file, const char *network_file)
 Convert a transit schedule from the Matsim format to the osurs format. More...
 
int print_network_from_file (const char *network_file, const char *reservations_file)
 Print the network from a file to stdout. More...
 
int main (int argc, char *argv[])
 Main function for the command line interface. More...
 

Detailed Description

Command line interface for converting transit schedules and printing networks.

This file contains functions for converting transit schedules from the Matsim format to the osurs format, and for printing the network from a file to stdout. The file also contains the main function for the command line interface, which allows the user to specify commands and arguments to invoke these functions.

Date
2022-12-22
Author
Merlin Unterfinger

Function Documentation

◆ convert_schedule()

int convert_schedule ( const char *  schedule_file,
const char *  vehicle_file,
const char *  network_file 
)

Convert a transit schedule from the Matsim format to the osurs format.

Parameters
schedule_fileThe Matsim schedule file to convert.
vehicle_fileThe Matsim vehicle file to convert.
network_fileThe output osurs network file.
Returns
1 if success, 0 if failure.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Main function for the command line interface.

Usage: cli [command] [arguments]

Available commands: convert [matsim_schedule_file] [matsim_vehicle_file] [osurs_network_file] print [osurs_network_file] [optional osurs_reservations_file]

Parameters
argcNumber of arguments.
argvArray of arguments.
Returns
0 if success, non-zero if failure.

◆ print_network_from_file()

int print_network_from_file ( const char *  network_file,
const char *  reservations_file 
)

Print the network from a file to stdout.

Parameters
network_fileThe osurs network file to print.
reservations_fileThe osurs reservations file to print.
Returns
1 if success, 0 if failure.