scripts/database.js
/**
 * Driver function for adding a new Custom Route and Model to their respective Drop-Down Lists, as well as to the Database
 * @param {ModelSimulator} simulator The simulator whose Route and Model used is to be added to the Drop-Down Lists and Database
 */
Driver function for adding a new Custom Route and Model to their respective Drop-Down Lists, as well as to the Database
@param {ModelSimulator} simulator The simulator whose Route and Model used is to be added to the Drop-Down Lists and Database
Driver function for adding a new Custom Route and Model to their respective Drop - Down Lists as well as to the Database @param { ModelSimulator } simulator The simulator whose Route and Model used is to be added to the Drop - Down Lists and Database
function addNewCustomRouteAndModel(simulator) {
	var modelURL = simulator.modelURL;
	var travelMethod = getTravelMethodID($("#method").val());
	var addRoute = function(modelID) {
		addNewCustomRoute(modelURL, travelMethod, modelID);
	}
	addNewCustomModel(modelURL, travelMethod, addRoute);
}
function addNewCustomRouteAndModel ( simulator ) { var modelURL = simulator . modelURL ; var travelMethod = getTravelMethodID ( $ ( "#method" ) . val ( ) ) ; var addRoute = function ( modelID ) { addNewCustomRoute ( modelURL , travelMethod , modelID ) ; } addNewCustomModel ( modelURL , travelMethod , addRoute ) ; }
Driver function for adding a new Custom Route and Model to their respective Drop-Down Lists, as well as to the Database
 @param {ModelSimulator} simulator The simulator whose Route and Model used is to be added to the Drop-Down Lists and Database
Driver function for adding a new Custom Route and Model to their respective Drop - Down Lists as well as to the Database @param { ModelSimulator } simulator The simulator whose Route and Model used is to be added to the Drop - Down Lists and Database
/* If a New Custom Model has been entered, the server will return the ID of the Model if it already exists, or the ID of the Model if it must be inserted.
	 * If a New Custom Model hasn't been given, the ID of the Model will be undefined. It will need to be determined by the server when
	 * we attempt to insert the New Custom Route. The modelURL (along with the Type - here "Custom") functionally determines a given Model and therefore its Model ID */ /* The insertion of the Route data is dependent on the results of the insertion of the Model data.
	 * AJAX calls are made asynchronously however, meaning that it cannot be guaranteed the Model
	 * insertion query will be finished before the Route insertion query begins.
	 * Therefore the insertion of the Route data is wrapped in a callback function to be executed upon the
	 * successful completion of the Model insertion query. */