void network::randomizeWeights (boost::function<baseType()> r, nodeBlueprint *n1 , nodeBlueprint *n2 ) { network::edgeList toChange; edgesBetween(toChange,n1, n2); edgeIterator it; for (it = toChange.begin(); it != toChange.end(); it++) if (getEdgeInfo(*it).theEdgeKind & _weighted_) setWeight(*it,r()); }
TopologyDialog::TopologyDialog(QWidget *parent) : QDialog(parent), ui(new Ui::TopologyDialog) { ui->setupUi(this); info = new Info(this); udpSocket = new QUdpSocket(this); udpSocket->bind(9996); timer = new QTimer(this); timer->start(5*1000); connect(udpSocket, SIGNAL(readyRead()), this, SLOT(getEdgeInfo())); connect(timer, SIGNAL(timeout()), this, SLOT(requestEdgeInfo())); initMap(); initAddressList(); test(); }