Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update node attributes #111

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions uxsim/uxsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,26 @@ def __init__(s, W, name, x, y, signal=[0], signal_offset=0, flow_capacity=None,
"""

s.W = W
#ノード位置(可視化用)
#node position (for visualization)
s.x = x
s.y = y

#custom attibutes
s.attribute = attribute

#流入・流出リンク
#incoming/outgoing links
s.inlinks = dict()
s.outlinks = dict()

#リンク間遷移リクエスト(デマンド)
#request for inter-link transfer (demand for node model)
s.incoming_vehicles = []

#発生車両流入待ち行列(vertical queue
#vertical queue for vehicle generation
s.generation_queue = deque()

#信号交差点
#signal=[0]であれば信号無し
#信号ありにするときはsignal=[group0の青時間,group1の青時間,...]とする
#signal settings
#If this node does not have a signal, set `signal=[0]`
#If this node has a signal, set `signal=[green time for group0, green time for group1. ...]`
s.signal = signal
s.signal_phase = 0
s.signal_t = 0
Expand All @@ -96,7 +99,7 @@ def __init__(s, W, name, x, y, signal=[0], signal_offset=0, flow_capacity=None,

s.signal_log = []

#流量制限(マクロ信号)
#flow capacity (macroscopic/continious representation for signal)
s.flag_lanes_automatically_determined = False
s.number_of_lanes = number_of_lanes
if flow_capacity != None:
Expand All @@ -105,7 +108,7 @@ def __init__(s, W, name, x, y, signal=[0], signal_offset=0, flow_capacity=None,
if number_of_lanes != None:
s.number_of_lanes = number_of_lanes
else:
s.number_of_lanes = math.ceil(flow_capacity/0.8) #TODO: 要調整.現状は1車線0.8 veh/sと見なし,車線数を決定している
s.number_of_lanes = math.ceil(flow_capacity/0.8) #the number of lanes is determined by assuming 0.8 veh/s capacity per lane
s.flag_lanes_automatically_determined = True
else:
s.flow_capacity = None
Expand Down