diff --git a/qns/entity/cchannel/cchannel_ex.py b/qns/entity/cchannel/cchannel_ex.py index b1c5e01..cc4bd9c 100644 --- a/qns/entity/cchannel/cchannel_ex.py +++ b/qns/entity/cchannel/cchannel_ex.py @@ -15,13 +15,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from typing import Any, List +from typing import List, Union from qns.simulator.ts import Time from qns.entity.node.node import QNode from qns.models.delay.delay import DelayModel from qns.simulator.simulator import Simulator -from qns.entity.cchannel.cchannel import * +from qns.utils.rnd import get_rand +import qns.utils.log as log +from qns.entity.cchannel.cchannel import ClassicPacket, ClassicChannel, RecvClassicPacket, NextHopNotConnectionException class ClassicChannelEx(ClassicChannel): @@ -35,8 +37,8 @@ def __init__( name: str = None, node_list: List[QNode] = [], bandwidth: int = 0, - delay: float | DelayModel = 0, - length: float | None = 0, + delay: Union[float, DelayModel] = 0, + length: Union[float, None] = 0, drop_rate: float = 0, max_buffer_size: int = 0, ): diff --git a/qns/simulator/stablepool.py b/qns/simulator/stablepool.py index 9f0e586..0e845fb 100644 --- a/qns/simulator/stablepool.py +++ b/qns/simulator/stablepool.py @@ -30,7 +30,7 @@ def __eq__(self, other) -> bool: return self.event == other.event and self.seq == other.seq def __lt__(self, other) -> bool: - return self.event < other.event or (@ + return self.event < other.event or ( self.event == other.event and self.seq < other.seq ) diff --git a/test/entity/test_cchannelex.py b/test/entity/test_cchannelex.py index f2ad33d..969c0ac 100644 --- a/test/entity/test_cchannelex.py +++ b/test/entity/test_cchannelex.py @@ -1,8 +1,10 @@ from qns.simulator.event import Event from qns.simulator import Simulator, func_to_event -from qns.utils.log import * from qns.simulator.stablepool import StableEventPool -from qns.entity import * +from qns.entity.node.node import QNode +from qns.entity.node.app import Application +from qns.utils.log import install +from qns.entity.cchannel.cchannel import ClassicChannel, ClassicPacket from qns.entity.cchannel.cchannel_ex import ClassicChannelEx