Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
01f4aa6e
Commit
01f4aa6e
authored
Sep 23, 2024
by
Hejing Li
Browse files
system/base.py: add find_peer function to interface class
parent
f43660c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
experiments/simbricks/orchestration/system/base.py
experiments/simbricks/orchestration/system/base.py
+9
-0
No files found.
experiments/simbricks/orchestration/system/base.py
View file @
01f4aa6e
...
@@ -74,6 +74,15 @@ class Interface(util_base.IdObj):
...
@@ -74,6 +74,15 @@ class Interface(util_base.IdObj):
assert
self
.
channel
is
None
assert
self
.
channel
is
None
self
.
channel
=
c
self
.
channel
=
c
def
find_peer
(
self
)
->
Interface
:
assert
self
.
channel
is
not
None
if
self
.
channel
.
a
==
self
:
peer_if
=
self
.
channel
.
b
else
:
peer_if
=
self
.
channel
.
a
return
peer_if
class
Channel
(
util_base
.
IdObj
):
class
Channel
(
util_base
.
IdObj
):
def
__init__
(
self
,
a
:
Interface
,
b
:
Interface
)
->
None
:
def
__init__
(
self
,
a
:
Interface
,
b
:
Interface
)
->
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment