Skip to content
Closed
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions qns/entity/cchannel/cchannel_ex.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

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):
Expand All @@ -35,7 +37,7 @@ def __init__(
name: str = None,
node_list: List[QNode] = [],
bandwidth: int = 0,
delay: float | DelayModel = 0,
delay: Union[float, DelayModel] = 0,
length: float | None = 0,
drop_rate: float = 0,
max_buffer_size: int = 0,
Expand Down
2 changes: 1 addition & 1 deletion qns/simulator/stablepool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
6 changes: 4 additions & 2 deletions test/entity/test_cchannelex.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
Loading