mirror of
https://github.com/Jerryplusy/AI-powered-switches.git
synced 2025-10-14 17:59:19 +00:00
又改回来了
This commit is contained in:
parent
0f856dc1e8
commit
da5743e27a
@ -13,7 +13,6 @@ class NetworkOptimizer:
|
|||||||
G = nx.Graph()
|
G = nx.Graph()
|
||||||
for device in devices:
|
for device in devices:
|
||||||
G.add_node(device['ip'], type=device['type'])
|
G.add_node(device['ip'], type=device['type'])
|
||||||
# 添加连接关系(示例)
|
|
||||||
G.add_edge('192.168.1.1', '192.168.1.2', bandwidth=1000)
|
G.add_edge('192.168.1.1', '192.168.1.2', bandwidth=1000)
|
||||||
return G
|
return G
|
||||||
|
|
||||||
@ -25,7 +24,6 @@ class NetworkOptimizer:
|
|||||||
"""带宽优化模型"""
|
"""带宽优化模型"""
|
||||||
|
|
||||||
def objective(x):
|
def objective(x):
|
||||||
# 最小化最大链路利用率
|
|
||||||
return max(x)
|
return max(x)
|
||||||
|
|
||||||
constraints = (
|
constraints = (
|
||||||
|
@ -4,7 +4,6 @@ from pathlib import Path
|
|||||||
from typing import List, Dict
|
from typing import List, Dict
|
||||||
from ..utils.logger import logger
|
from ..utils.logger import logger
|
||||||
|
|
||||||
|
|
||||||
class NetworkScanner:
|
class NetworkScanner:
|
||||||
def __init__(self, cache_path: str = "switch_devices.json"):
|
def __init__(self, cache_path: str = "switch_devices.json"):
|
||||||
self.cache_path = Path(cache_path)
|
self.cache_path = Path(cache_path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user