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
342a58b8
Commit
342a58b8
authored
Aug 27, 2024
by
Hejing Li
Browse files
simulation/channel.py: add channel
parent
a76a7c55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
experiments/simbricks/orchestration/simulation/channel.py
experiments/simbricks/orchestration/simulation/channel.py
+13
-2
No files found.
experiments/simbricks/orchestration/simulation/channel.py
View file @
342a58b8
...
@@ -21,14 +21,25 @@
...
@@ -21,14 +21,25 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import
typing
as
tp
import
typing
as
tp
import
simbricks.orchestration.simulation.base
as
base
import
simbricks.orchestration.simulation.base
as
sim_
base
import
simbricks.orchestration.experiments
as
exp
import
simbricks.orchestration.experiments
as
exp
import
simbricks.orchestration.system.base
as
system_base
from
simbricks.orchestration.experiment.experiment_environment_new
import
ExpEnv
from
simbricks.orchestration.experiment.experiment_environment_new
import
ExpEnv
class
Channel
(
base
.
Simulator
):
class
Channel
(
sim_
base
.
Simulator
):
def
__init__
(
self
,
e
:
exp
.
Experiment
):
def
__init__
(
self
,
e
:
exp
.
Experiment
):
super
().
__init__
(
e
)
super
().
__init__
(
e
)
self
.
sync_period
=
500
# nano second
self
.
sync_period
=
500
# nano second
self
.
sys_channel
:
system_base
.
Channel
=
None
def
full_name
(
self
)
->
str
:
return
'channel.'
+
self
.
name
def
add
(
self
,
ch
:
system_base
.
Channel
):
self
.
sys_channel
=
ch
self
.
name
=
f
'
{
ch
.
id
}
'
self
.
experiment
.
sys_sim_map
[
ch
]
=
self
\ No newline at end of file
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