Esempio n. 1
0
void ODSet::projectPathFlowOnLinks(){
	
	FPType flow = 0.0;
	for (PathIterator pathIt = begin(); pathIt != end(); ++pathIt) {
		Path* path = *pathIt;
		flow = path->getFlow() - path->getPrevFlow();
		if (fabs(flow) > zeroFlow_) {
			for (StarLinkIterator it = path->begin(); it != path->end(); ++it) {
				(*it)->addFlow(flow);
			}
		}
	}
	for (PathIterator pathIt = begin(); pathIt != end(); ++pathIt) {
		Path* path = *pathIt;
		for (StarLinkIterator it = path->begin(); it != path->end(); ++it) {
			StarLink* link = *it;
			if (link->getFlow() < zeroFlow_) {
					link->setFlow(0.0);
			}
			link->updateTime();
		}
	}

};
Esempio n. 2
0
void LinkFlows::updateLinkFlows(){
	for (StarLink *link = net_->beginOnlyLink(); link != NULL; link = net_->getNextOnlyLink()) {
		link->setFlow(linkFlows_[link->getIndex()]);
		link->updateTime();
	}
};