Esempio n. 1
0
bool TPPlus_Matrix::Read_Matrix (void)
{
	int n;

	Int_Map *org_map;
	Int_Map_Itr org_itr;

	if (!Data_Flag () || !Matrix_Flag ()) {
		if (!Allocate_Data (true)) return (false);
	}
	exe->Show_Message (String ("Reading %s -- Record") % File_Type ());
	exe->Set_Progress ();

	org_map = Org_Map ();

	for (org_itr = org_map->begin (); org_itr != org_map->end (); org_itr++) {
		for (n=0; n < Tables (); n++) {
			exe->Show_Progress ();
			TppMatReadSelect (fh, org_itr->first, n+1, Matrix_Ptr (0, org_itr->second, n));
		}
	}
	exe->End_Progress ();
	exe->Print (2, String ("Number of %s Records = %d") % File_Type () % exe->Progress_Count ());
	return (true);
}
Esempio n. 2
0
bool TPPlus_Matrix::Write_Matrix (void)
{
	int i, n, org;

	Int_Map *org_map;
	Int_Map_Itr org_itr;
	
	if (!Matrix_Flag ()) return (false);

	exe->Show_Message (String ("Writing %s -- Record") % File_Type ());
	exe->Set_Progress ();

	org_map = Org_Map ();

	//---- process each origin zone ----

	for (org_itr = org_map->begin (); org_itr != org_map->end (); org_itr++) {
		org = org_itr->first - 1;
		i = org_itr->second;

		for (n=0; n < Tables (); n++) {
			exe->Show_Progress ();

			TppMatMatWriteRow (fh, org, n+1, fh->Mspecs [n], Matrix_Ptr (0, i, n));
		}
	}
	exe->End_Progress ();
	exe->Print (2, String ("Number of %s Records = %d") % File_Type () % exe->Progress_Count ());
	return (true);
}
Esempio n. 3
0
void Tour_File::Setup (void)
{
	if (File_Access () == CREATE) {
		File_Type ("New Tour Data File");
		File_ID ("NewTour");
	} else {
		File_Type ("Tour Data File");
		File_ID ("Tour");
	}
	hhold = person = tour = purpose = mode = origin = destination = stop_out = stop_in = start = end = group = 0;
}
Esempio n. 4
0
bool TransCAD_Matrix::Write_Matrix (void)
{
	int i, n, org;
	DATA_TYPE type;

	Int_Map *org_map;
	Int_Map_Itr org_itr;
	
	if (!Matrix_Flag ()) return (false);

	exe->Show_Message (String ("Writing %s -- Record") % File_Type ());
	exe->Set_Progress ();

	org_map = Org_Map ();

	switch (Type ()) {
		default:
		case DB_DOUBLE:
			type = DOUBLE_TYPE;
			break;
		case DB_FLOAT:
			type = FLOAT_TYPE;
			break;
		case DB_INTEGER:
			type = LONG_TYPE;
			break;
		case DB_SHORT:
			type = SHORT_TYPE;
			break;
	}

	//---- process each origin zone ----

	for (org_itr = org_map->begin (); org_itr != org_map->end (); org_itr++) {
		org = org_itr->first - 1;
		i = org_itr->second;

		for (n=0; n < Tables (); n++) {
			exe->Show_Progress ();

			MATRIX_SetCore (fh, (short) n);
			MATRIX_SetBaseVector (fh, org, MATRIX_ROW, type, Matrix_Ptr (0, i, n));
		}
	}
	exe->End_Progress ();
	exe->Print (2, String ("Number of %s Records = %d") % File_Type () % exe->Progress_Count ());
	return (true);
}
Esempio n. 5
0
void Access_File::Setup (void)
{
	File_Type ("Access File");
	File_ID ("Access");

	link = from_id = to_id = from_type = to_type = dir = time = cost = -1;
}
Esempio n. 6
0
void Node_File::Setup (void)
{
	File_Type ("Node File");
	File_ID ("Node");

	node = x = y = z = subarea = part = -1;
}
Esempio n. 7
0
void Timing_File::Setup (void)
{
	File_Type ("Timing Plan File");
	File_ID ("Timing");

	timing = phase = next = minimum = maximum = extend = yellow = red = ring = group = 0;
}
Esempio n. 8
0
void Sign_File::Setup (void)
{
	File_Type ("Sign File");
	File_ID ("Sign");

	link = dir = sign = -1;
}
Esempio n. 9
0
void Count_File::Setup (void)
{
	File_Type ("Traffic Count File");
	File_ID ("Count");

	anode = bnode = start = end = count = 0;
}
Esempio n. 10
0
void Ridership_File::Setup (void)
{
	File_Type ("Transit Ridership File");
	File_ID ("Ridership");

	mode = route = run = stop = schedule = time = board = alight = load = factor = 0;
}
Esempio n. 11
0
void Coordinator_File::Setup (void)
{
	File_Type ("Signal Coordinator File");
	File_ID ("Coordinator");

	id = 0;
}
Esempio n. 12
0
void Boundary_File::Setup (void)
{
	File_Type ("Boundary Speed File");
	File_ID ("Boundary");

	parking = start = end = speed = 0;
}
Esempio n. 13
0
void Parking_File::Setup (void)
{
	File_Type ("Parking File");
	File_ID ("Parking");

	id = link = node = offset = type = use = space = start = end = hourly = daily = 0;
}
Esempio n. 14
0
void System_Event_File::Setup (void)
{
	File_Type ("System Event File");
	File_ID ("SysEvent");

	time = type = node = plan = phase = ring = group = status = 0;
}
Esempio n. 15
0
void Fare_File::Setup (void)
{
	File_Type ("Transit Fare File");
	File_ID ("Fare");

	from_zone = to_zone = from_mode = to_mode = period = type = fare = -1;
}
Esempio n. 16
0
void Location_File::Setup (void)
{
	File_Type ("Location File");
	File_ID ("Location");

	location = link = dir = offset = setback = zone = -1;
}
Esempio n. 17
0
void Location_File::Setup (void)
{
	File_Type ("Activity Location File");
	File_ID ("Location");

	location = link = node = offset = x = y = zone = 0;
}
Esempio n. 18
0
void Event_File::Setup (void)
{
	File_Type ("Event File");
	File_ID ("Event");

	hhold = person = mode = trip = leg = type = schedule = actual = link = offset = 0;
}
Esempio n. 19
0
void Route_Nodes_File::Setup (void)
{
	File_Type ("Route Nodes File");
	File_ID ("RouteNodes");

	dwell_flag = time_flag = speed_flag = false;
	route = node = dwell = time = speed = 0;
}
Esempio n. 20
0
void Veh_Type_File::Setup (void)
{
	File_Type ("Vehicle Type File");
	File_ID ("VehType");

	type = sub_type = length = max_speed = max_accel = max_decel = use = capacity = 0;
	load = unload = method = min_dwell = max_dwell = 0;
}
Esempio n. 21
0
void Connect_File::Setup (void)
{
	File_Type ("Connection File");
	File_ID ("Connect");

	link = dir = to_link = lanes = to_lanes = in_high = out_high = -1;
	type = penalty = speed = capacity = -1;
}
Esempio n. 22
0
int Db_Base::Required_Field (string name)
{
	int num = Field_Number (name);

	if (num < 0 && exe->Send_Messages ()) {
		exe->Error (String ("%s does not include \"%s\" field") % File_Type () % name);
	}
	return (num);
}
Esempio n. 23
0
void Veh_Type_File::Setup (void)
{
	File_Type ("Vehicle Type File");
	File_ID ("VehType");

	type = length = max_speed = max_accel = max_decel = op_cost = use = capacity = max_load = -1;
	occupancy = load = unload = method = min_dwell = max_dwell = subtype = -1;
	grade = fuel = fuel_cap = -1;
}
Esempio n. 24
0
void Factor_File::Setup (void)
{
	Matrix_File::Setup ();

	File_Type ("Correction Factor File");
	File_ID ("Factor");

	factor = 0;
}
Esempio n. 25
0
void Travel_Time_File::Setup (void)
{
	File_Type ("Travel Time File");
	File_ID ("TravelTime");

	hhold = person = tour = trip = mode = base_start = started = start_diff = -1;
	base_end = ended = end_diff = mid_trip = ttime = -1;
	purpose = constraint = start_link = end_link = trip_start =  trip_end = -1;
}
Esempio n. 26
0
void Link_Detail_File::Setup (void)
{
	File_Type ("Link Detail File");
	File_ID ("Detail");

	link = dir = control = group = use = lanes = period = -1;
	left_merge = left = left_thru = thru = right_thru = right = right_merge = -1;
	lm_length = lt_length = rt_length = rm_length = -1;
}
Esempio n. 27
0
void Link_Delay_File::Setup (void)
{
	File_Type ("Link Delay File");
	File_ID ("Delay");

	Set_Nesting (turn_flag);

	link = dir = type = start = end = flow = time = -1;
	out_link = out_flow = out_time = -1;
}
Esempio n. 28
0
void Snapshot_File::Setup (void)
{
    File_Type ("Snapshot File");
    File_ID ("Snapshot");

    hhold = vehicle = time = link = dir = lane = offset = speed = pass = type = -1;
    wait = diff = user = cell = x = y = z = bearing = blob = -1;
    location_flag = cell_flag = status_flag = compress = false;
    rec = 0;
    index = 0;
    units = METERS;
}
Esempio n. 29
0
void Skim_File::Setup (void)
{
	Matrix_File::Setup ();

	File_Type ("Zone Skim File");
	File_ID ("Skim");

	transit_flag = drive_flag = other_flag = length_flag = true;
	total_flag = false;

	mode = count = walk = wait = transit = drive = other = length = cost = 0;
	time = variance = total = 0;
}
Esempio n. 30
0
bool Snapshot_File::Open (string filename)
{
    if (filename.empty ()) {
        filename = Filename ();
    }
    if (filename.empty ()) return (false);

    File_Type (File_Type ());
    File_Access (File_Access ());

    //---- open the snapshot file ----

    bool status = Db_Header::Open (filename);

    //---- set up and open the index file ----

    if (compress) {
        bool messages;

        messages = exe->Send_Messages ();
        exe->Send_Messages (false);

        index_file.File_Type (File_Type () + " Index");
        index_file.File_Access (File_Access ());
        index_file.File_Format (BINARY);

        filename += ".idx";

        status = index_file.Open (filename);

        index_file.Record_Size (sizeof (Index_Record));

        index = (Index_Record *) index_file.Record_String ();

        exe->Send_Messages (messages);
    }
    if (!status) return (Status (NOT_OPEN));
    return (status);
}