示例#1
0
bool Location_File::Set_Field_Numbers (void)
{
	//---- required fields ----

	location = Required_Field ("LOCATION", "ID");
	link = Required_Field ("LINK");
	offset = Required_Field ("OFFSET");

	if (location < 0 || link < 0 || offset < 0) return (false);

	//---- optional fields ----

	setback = Optional_Field ("SETBACK");
	zone = Optional_Field ("ZONE", "TAZ");

	dir = LinkDir_Type_Field ();
	Notes_Field (Optional_Field ("NOTES"));
	
	//---- set default units ----

	Set_Units (offset, METERS);
	Set_Units (setback, METERS);

	return (true);
}
示例#2
0
bool Sign_File::Set_Field_Numbers (void)
{
	//---- required fields ----

	link = Required_Field ("LINK", "INLINK", "LINK_IN");
	sign = Required_Field ("SIGN");

	if (link < 0 || sign < 0) return (false);

	dir = LinkDir_Type_Field ();
	Notes_Field (Optional_Field ("NOTES"));

	//---- set default units ----
	
	Set_Units (sign, CONTROL_CODE);

	return (true);
}
示例#3
0
bool Connect_File::Set_Field_Numbers (void)
{

	//---- required fields ----

	link = Required_Field (IN_LINK_FIELD_NAMES);
	to_link = Required_Field (OUT_LINK_FIELD_NAMES);

	if (link < 0 || to_link < 0) return (false);

	//---- optional fields ----
	
	dir = LinkDir_Type_Field ();
	lanes = Optional_Field ("LANES", "IN_LOW", "INLANE", "LANE_IN", "LANEIN");
	to_lanes = Optional_Field ("TO_LANES", "OUT_LOW", "OUTLANE", "LANE_OUT", "LANEOUT");
	type = Optional_Field ("TYPE", "MOVEMENT", "TURN", "TURNTYPE", "TURN_TYPE");
	penalty = Optional_Field ("PENALTY", "DELAY");
	speed = Optional_Field ("SPEED", "MAX_SPD");
	capacity = Optional_Field ("CAPACITY", "SAT_FLOW");
	Notes_Field (Optional_Field (NOTES_FIELD_NAMES));

	//---- set default units ----
	
	if (Version () <= 40) {
		in_high = Optional_Field ("IN_HIGH", "HIGH_IN", "LANES", "LANE_IN", "LANEIN");
		out_high = Optional_Field ("OUT_HIGH", "HIGH_OUT", "TO_LANES", "LANE_OUT", "LANEOUT");
		Set_Units (type, CONNECT_CODE);
		Set_Units (penalty, IMPEDANCE);
		Set_Units (speed, MPS);
		Set_Units (capacity, VPH);
	} else {
		Set_Units (lanes, LANE_RANGE_CODE);
		Set_Units (to_lanes, LANE_RANGE_CODE);
		in_high = out_high = -1;
		Set_Units (type, CONNECT_CODE);
		Set_Units (penalty, IMPEDANCE);
		Set_Units (speed, MPH);
		Set_Units (capacity, VPH);
	}
	return (true);
}
示例#4
0
bool Link_Detail_File::Set_Field_Numbers (void)
{
	//---- required fields ----

	link = Required_Field ("LINK");

	if (link < 0) return (false);
	
	dir = LinkDir_Type_Field ();
	control = Optional_Field ("CONTROL", "TYPE", "INT_TYPE");
	group = Optional_Field ("GROUP", "TYPE");
	lm_length = Optional_Field ("LM_LENGTH", "LM_LEN");
	left_merge = Optional_Field ("L_MERGE", "LEFT_MERGE", "LT_MERGE");
	lt_length = Optional_Field ("LT_LENGTH", "LT_LEN", "LEFT_LEN");
	left = Optional_Field ("LEFT", "LEFT_TURN", "L");
	left_thru = Optional_Field ("LEFT_THRU", "SHARED_LEFT", "LT");
	thru = Optional_Field ("THRU", "T");
	right_thru = Optional_Field ("RIGHT_THRU", "SHARED_RIGHT", "RT");
	right = Optional_Field ("RIGHT", "R");
	rt_length = Optional_Field ("RT_LENGTH", "RT_LEN", "RIGHT_LEN");
	right_merge = Optional_Field ("R_MERGE", "RIGHT_MERGE", "RT_MERGE");
	rm_length = Optional_Field ("RM_LENGTH", "RM_LEN");
	use = Optional_Field ("USE", "USE_TYPE", "VEHICLE");
	lanes = Optional_Field ("LANES", "USE_LANES", "LANE");
	period = Optional_Field ("PERIOD", "USE_PERIOD", "USE_TIME");

	Notes_Field (Optional_Field ("NOTES"));

	//---- set default units ----

	Set_Units (control, CONTROL_CODE);
	Set_Units (lm_length, METERS);
	Set_Units (lt_length, METERS);
	Set_Units (rt_length, METERS);
	Set_Units (rm_length, METERS);
	Set_Units (use, USE_CODE);
	if (Version () > 40) Set_Units (lanes, LANE_RANGE_CODE);

	return (true);
}
示例#5
0
bool Link_Delay_File::Set_Field_Numbers (void)
{
	bool flag = false;

	//---- required fields ----

	link = Required_Field ("LINK");
	flow = Required_Field (FLOW_RATE_FIELD_NAMES);

	if (Version () <= 40) {
		start = Optional_Field (START_FIELD_NAMES);
		end = Optional_Field (END_FIELD_NAMES);

		if (start < 0 && end < 0) {
			start = end = Required_Field ("PERIOD", "TIME");
			time = Required_Field ("AVG_TIME", "TTIME", "SUM");
			flag = true;
		} else {
			time = Required_Field (TRAVEL_TIME_FIELD_NAMES);
		}
	} else {
		time = Required_Field (TRAVEL_TIME_FIELD_NAMES);
		start = Required_Field (START_FIELD_NAMES);
		end = Required_Field (END_FIELD_NAMES);
	}

	if (link < 0 || flow < 0 || time < 0 || start < 0 || end < 0) return (false);

	//---- other required fields ----

	dir = LinkDir_Type_Field ();

	type = Optional_Field ("TYPE", "USE", "HOV", "GROUP");

	//---- nested optional fields ----

	Num_Nest_Field (Optional_Field (CONNECTION_FIELD_NAMES));
	if (Num_Nest_Field () < 0) turn_flag = false;

	out_link = Optional_Field (OUT_LINK_FIELD_NAMES);
	out_flow = Optional_Field (FLOW_OUT_FIELD_NAMES);
	out_time = Optional_Field (TIME_OUT_FIELD_NAMES);

	//---- set default units ----

	if (flag) {
		Set_Units (start, SECONDS);
		Set_Units (end, SECONDS);
	} else {
		Set_Units (start, DAY_TIME);
		Set_Units (end, DAY_TIME);
	}
	Set_Units (flow, flow_units);
	Set_Units (time, SECONDS);
	Set_Units (out_flow, flow_units);
	Set_Units (out_time, SECONDS);

	Units_Type units = Get_Units (flow);
	if (units != NO_UNITS) Flow_Units (units);

	Lane_Use_Flows ((type >= 0));

	return (true);
}
示例#6
0
bool Snapshot_File::Set_Field_Numbers (void)
{
    //---- compress check ----

    blob = Optional_Field ("COMPRESS");

    if (blob >= 0) {
        compress = true;
        rec = (Compressed_Snapshot *) Record_String ();
        Set_Units (blob, METERS);
        units = Field (blob)->Units ();
        Status_Flag (true);
        return (true);
    }
    compress = false;

    //---- required fields ----

    if (Version () <= 40) {
        hhold = Required_Field ("DRIVER", "VEHICLE");
    } else {
        hhold = Required_Field (HHOLD_FIELD_NAMES);
    }
    vehicle = Required_Field (VEHICLE_FIELD_NAMES);
    link = Required_Field ("LINK");
    time = Required_Field ("TIME");
    link = Required_Field ("LINK");
    lane = Required_Field ("LANE");
    offset = Required_Field ("OFFSET", "DISTANCE");
    speed = Required_Field ("SPEED", "VELOCITY");

    if (hhold < 0 || vehicle < 0 || time < 0 || link < 0 || lane < 0 || offset < 0 || speed < 0) return (false);

    //---- optional fields ----

    dir = LinkDir_Type_Field ();

    cell = Optional_Field ("CELL", "PART");
    pass = Optional_Field ("PASSENGERS", "OCCUPANCY");
    type = Optional_Field ("TYPE", "VEHTYPE", "VEH_TYPE");
    wait = Optional_Field ("WAIT", "STOPTIME", "DELAY");
    diff = Optional_Field ("TIME_DIFF", "VARIANCE", "DIFFERENCE");
    user = Optional_Field ("USER", "DATA");
    x = Optional_Field (X_FIELD_NAMES);
    y = Optional_Field (Y_FIELD_NAMES);
    z = Optional_Field (Z_FIELD_NAMES);
    bearing = Optional_Field ("BEARING", "DIRECTION", "DEGREES");

    Cell_Flag (cell >= 0);
    Location_Flag (x >= 0 && y >= 0 && bearing >= 0);
    Status_Flag (wait >= 0 || diff >= 0 || user >= 0);

    //---- set default units ----

    Set_Units (time, DAY_TIME);
    Set_Units (lane, LANE_ID_CODE);
    Set_Units (offset, METERS);
    Set_Units (speed, MPS);
    Set_Units (type, VEH_TYPE);
    Set_Units (wait, SECONDS);
    Set_Units (diff, SECONDS);
    Set_Units (x, METERS);
    Set_Units (y, METERS);
    Set_Units (z, METERS);
    Set_Units (bearing, DEGREES);

    return (true);
}