parent
							
								
									7ce75733d0
								
							
						
					
					
						commit
						8cddaf39c4
					
				| @ -156,7 +156,6 @@ void EdgeBasedGraphFactory::Run() { | |||||||
|                 currentNode.lon2 = inputNodeInfoList[v].lon; |                 currentNode.lon2 = inputNodeInfoList[v].lon; | ||||||
|                 currentNode.id = _nodeBasedGraph->GetEdgeData(e1).edgeBasedNodeID; |                 currentNode.id = _nodeBasedGraph->GetEdgeData(e1).edgeBasedNodeID; | ||||||
|                 currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e1).ignoreInGrid; |                 currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e1).ignoreInGrid; | ||||||
| 
 |  | ||||||
| //                short startHeight = srtmLookup.height(currentNode.lon1/100000.,currentNode.lat1/100000. );
 | //                short startHeight = srtmLookup.height(currentNode.lon1/100000.,currentNode.lat1/100000. );
 | ||||||
| //                short targetHeight = srtmLookup.height(currentNode.lon2/100000.,currentNode.lat2/100000. );
 | //                short targetHeight = srtmLookup.height(currentNode.lon2/100000.,currentNode.lat2/100000. );
 | ||||||
| //                short heightDiff = startHeight - targetHeight;
 | //                short heightDiff = startHeight - targetHeight;
 | ||||||
| @ -242,6 +241,7 @@ void EdgeBasedGraphFactory::Run() { | |||||||
|                             currentNode.lon2 = inputNodeInfoList[w].lon; |                             currentNode.lon2 = inputNodeInfoList[w].lon; | ||||||
|                             currentNode.id = edgeBasedTarget; |                             currentNode.id = edgeBasedTarget; | ||||||
|                             currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e2).ignoreInGrid; |                             currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e2).ignoreInGrid; | ||||||
|  |                             INFO("created node #" << edgeBasedNodes.size() << " (" << v << "," << w << ")"); | ||||||
|                             edgeBasedNodes.push_back(currentNode); |                             edgeBasedNodes.push_back(currentNode); | ||||||
| 
 | 
 | ||||||
|                         } |                         } | ||||||
| @ -254,7 +254,6 @@ void EdgeBasedGraphFactory::Run() { | |||||||
|                             currentNode.lon2 = inputNodeInfoList[v].lon; |                             currentNode.lon2 = inputNodeInfoList[v].lon; | ||||||
|                             currentNode.id = edgeBasedSource; |                             currentNode.id = edgeBasedSource; | ||||||
|                             currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e1).ignoreInGrid; |                             currentNode.ignoreInGrid = _nodeBasedGraph->GetEdgeData(e1).ignoreInGrid; | ||||||
| 
 |  | ||||||
| //                            short startHeight = srtmLookup.height(currentNode.lon1/100000.,currentNode.lat1/100000. );
 | //                            short startHeight = srtmLookup.height(currentNode.lon1/100000.,currentNode.lat1/100000. );
 | ||||||
| //                            short targetHeight = srtmLookup.height(currentNode.lon2/100000.,currentNode.lat2/100000. );
 | //                            short targetHeight = srtmLookup.height(currentNode.lon2/100000.,currentNode.lat2/100000. );
 | ||||||
| //                            short heightDiff = startHeight - targetHeight;
 | //                            short heightDiff = startHeight - targetHeight;
 | ||||||
|  | |||||||
| @ -206,6 +206,7 @@ public: | |||||||
|         if(INT_MAX != resultNode.weight2) { |         if(INT_MAX != resultNode.weight2) { | ||||||
|             resultNode.weight2 -= resultNode.weight1; |             resultNode.weight2 -= resultNode.weight1; | ||||||
|         } |         } | ||||||
|  |         resultNode.ratio = ratio; | ||||||
|         //        INFO("New weight1: " << resultNode.weight1 << ", new weight2: " << resultNode.weight2);
 |         //        INFO("New weight1: " << resultNode.weight1 << ", new weight2: " << resultNode.weight2);
 | ||||||
|         //        INFO("selected node: " << resultNode.edgeBasedNode << ", bidirected: " << (resultNode.isBidirected() ? "yes" : "no") <<  "\n--")
 |         //        INFO("selected node: " << resultNode.edgeBasedNode << ", bidirected: " << (resultNode.isBidirected() ? "yes" : "no") <<  "\n--")
 | ||||||
|         return foundNode; |         return foundNode; | ||||||
|  | |||||||
| @ -24,17 +24,19 @@ or see http://www.gnu.org/licenses/agpl.txt. | |||||||
| #include "ExtractorStructs.h" | #include "ExtractorStructs.h" | ||||||
| 
 | 
 | ||||||
| struct PhantomNode { | struct PhantomNode { | ||||||
|     PhantomNode() : edgeBasedNode(UINT_MAX), nodeBasedEdgeNameID(UINT_MAX), weight1(INT_MAX), weight2(INT_MAX) {} |     PhantomNode() : edgeBasedNode(UINT_MAX), nodeBasedEdgeNameID(UINT_MAX), weight1(INT_MAX), weight2(INT_MAX), ratio(0.) {} | ||||||
|     NodeID edgeBasedNode; |     NodeID edgeBasedNode; | ||||||
|     unsigned nodeBasedEdgeNameID; |     unsigned nodeBasedEdgeNameID; | ||||||
|     int weight1; |     int weight1; | ||||||
|     int weight2; |     int weight2; | ||||||
|  |     double ratio; | ||||||
|     _Coordinate location; |     _Coordinate location; | ||||||
|     void Reset() { |     void Reset() { | ||||||
|         edgeBasedNode = UINT_MAX; |         edgeBasedNode = UINT_MAX; | ||||||
|         nodeBasedEdgeNameID = UINT_MAX; |         nodeBasedEdgeNameID = UINT_MAX; | ||||||
|         weight1 = INT_MAX; |         weight1 = INT_MAX; | ||||||
|         weight2 = INT_MAX; |         weight2 = INT_MAX; | ||||||
|  |         ratio = 0.; | ||||||
|         location.Reset(); |         location.Reset(); | ||||||
|     } |     } | ||||||
|     bool isBidirected() const { |     bool isBidirected() const { | ||||||
|  | |||||||
| @ -334,11 +334,22 @@ public: | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | //		INFO("dist: " << _upperbound);
 | ||||||
| 		if ( _upperbound == INT_MAX ) { | 		if ( _upperbound == INT_MAX ) { | ||||||
| 			return _upperbound; | 			return _upperbound; | ||||||
| 		} | 		} | ||||||
| 		std::deque<NodeID> packedPath; | 		std::deque<NodeID> packedPath; | ||||||
| 		_RetrievePackedPathFromHeap(_forwardHeap, _backwardHeap, middle, packedPath); | 		_RetrievePackedPathFromHeap(_forwardHeap, _backwardHeap, middle, packedPath); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 		//Setting weights to correspond with that of the actual chosen path
 | ||||||
|  | 		if(packedPath[0] == phantomNodes.startPhantom.edgeBasedNode && phantomNodes.startPhantom.isBidirected()) { | ||||||
|  | //            INFO("Setting weight1=" << phantomNodes.startPhantom.weight1 << " to that of weight2=" << phantomNodes.startPhantom.weight2);
 | ||||||
|  |             phantomNodes.startPhantom.weight1 = phantomNodes.startPhantom.weight2; | ||||||
|  | 		} else { | ||||||
|  | //            INFO("Setting weight2=" << phantomNodes.startPhantom.weight2 << " to that of weight1=" << phantomNodes.startPhantom.weight1);
 | ||||||
|  |             phantomNodes.startPhantom.weight2 = phantomNodes.startPhantom.weight1; | ||||||
|  | 		} | ||||||
| //		std::cout << "0: ";
 | //		std::cout << "0: ";
 | ||||||
| //		for(unsigned i = 0; i < packedPath.size(); ++i)
 | //		for(unsigned i = 0; i < packedPath.size(); ++i)
 | ||||||
| //			std::cout << packedPath[i] << " ";
 | //			std::cout << packedPath[i] << " ";
 | ||||||
|  | |||||||
| @ -34,24 +34,6 @@ or see http://www.gnu.org/licenses/agpl.txt. | |||||||
| 
 | 
 | ||||||
| #include "../Plugins/RawRouteData.h" | #include "../Plugins/RawRouteData.h" | ||||||
| 
 | 
 | ||||||
| struct _RouteSummary { |  | ||||||
|     std::string lengthString; |  | ||||||
|     std::string durationString; |  | ||||||
|     std::string startName; |  | ||||||
|     std::string destName; |  | ||||||
|     _RouteSummary() : lengthString("0"), durationString("0"), startName("unknown street"), destName("unknown street") {} |  | ||||||
|     void BuildDurationAndLengthStrings(unsigned distance, unsigned time) { |  | ||||||
|         //compute distance/duration for route summary
 |  | ||||||
|         std::ostringstream s; |  | ||||||
|         s << 10*(round(distance/10.)); |  | ||||||
|         lengthString = s.str(); |  | ||||||
|         int travelTime = time/10 + 1; |  | ||||||
|         s.str(""); |  | ||||||
|         s << travelTime; |  | ||||||
|         durationString = s.str(); |  | ||||||
|     } |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| struct _DescriptorConfig { | struct _DescriptorConfig { | ||||||
|     _DescriptorConfig() : instructions(true), geometry(true), encodeGeometry(false), z(18) {} |     _DescriptorConfig() : instructions(true), geometry(true), encodeGeometry(false), z(18) {} | ||||||
|     bool instructions; |     bool instructions; | ||||||
|  | |||||||
| @ -65,9 +65,10 @@ void DescriptionFactory::AppendUnencodedPolylineString(std::string &output) { | |||||||
|     pc.printUnencodedString(pathDescription, output); |     pc.printUnencodedString(pathDescription, output); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| unsigned DescriptionFactory::Run(const unsigned zoomLevel) { | void DescriptionFactory::Run(const unsigned zoomLevel, const unsigned duration) { | ||||||
|  | 
 | ||||||
|     if(0 == pathDescription.size()) |     if(0 == pathDescription.size()) | ||||||
|         return 0; |         return; | ||||||
| 
 | 
 | ||||||
|     unsigned entireLength = 0; |     unsigned entireLength = 0; | ||||||
|     /** starts at index 1 */ |     /** starts at index 1 */ | ||||||
| @ -94,8 +95,24 @@ unsigned DescriptionFactory::Run(const unsigned zoomLevel) { | |||||||
|             indexOfSegmentBegin = i; |             indexOfSegmentBegin = i; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     if(pathDescription[0].length == 0){ | 
 | ||||||
|         pathDescription[0].turnInstruction = 14; |     //Post-processing to remove empty or nearly empty path segments
 | ||||||
|  |     if(0. == startPhantom.ratio || 0 == pathDescription[0].length) { | ||||||
|  |         pathDescription.erase(pathDescription.begin()); | ||||||
|  |         pathDescription[0].turnInstruction = TurnInstructions.HeadOn; | ||||||
|  |         pathDescription[0].necessary = true; | ||||||
|  |         startPhantom.nodeBasedEdgeNameID = pathDescription[0].nameID; | ||||||
|  |     } else { | ||||||
|  |         pathDescription[0].duration *= startPhantom.ratio; | ||||||
|  |     } | ||||||
|  |     if(1. == targetPhantom.ratio || 0 == pathDescription.back().length) { | ||||||
|  |         pathDescription.pop_back(); | ||||||
|  |         pathDescription.back().necessary = true; | ||||||
|  |         pathDescription.back().turnInstruction = TurnInstructions.NoTurn; | ||||||
|  |         targetPhantom.nodeBasedEdgeNameID = (pathDescription.end()-2)->nameID; | ||||||
|  | //        INFO("Deleting last turn instruction");
 | ||||||
|  |     } else { | ||||||
|  |         pathDescription[indexOfSegmentBegin].duration *= (1.-targetPhantom.ratio); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     //Generalize poly line
 |     //Generalize poly line
 | ||||||
| @ -109,5 +126,12 @@ unsigned DescriptionFactory::Run(const unsigned zoomLevel) { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return entireLength; |     BuildRouteSummary(entireLength, duration); | ||||||
|  |     return; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void DescriptionFactory::BuildRouteSummary(const unsigned distance, const unsigned time) { | ||||||
|  |     summary.startName = startPhantom.nodeBasedEdgeNameID; | ||||||
|  |     summary.destName = targetPhantom.nodeBasedEdgeNameID; | ||||||
|  |     summary.BuildDurationAndLengthStrings(distance, time); | ||||||
| } | } | ||||||
|  | |||||||
| @ -28,6 +28,7 @@ | |||||||
| #include "../Algorithms/PolylineCompressor.h" | #include "../Algorithms/PolylineCompressor.h" | ||||||
| #include "../DataStructures/ExtractorStructs.h" | #include "../DataStructures/ExtractorStructs.h" | ||||||
| #include "../DataStructures/SegmentInformation.h" | #include "../DataStructures/SegmentInformation.h" | ||||||
|  | #include "../DataStructures/TurnInstructions.h" | ||||||
| 
 | 
 | ||||||
| /* This class is fed with all way segments in consecutive order
 | /* This class is fed with all way segments in consecutive order
 | ||||||
|  *  and produces the description plus the encoded polyline */ |  *  and produces the description plus the encoded polyline */ | ||||||
| @ -36,7 +37,28 @@ class DescriptionFactory { | |||||||
|     DouglasPeucker<SegmentInformation> dp; |     DouglasPeucker<SegmentInformation> dp; | ||||||
|     PolylineCompressor pc; |     PolylineCompressor pc; | ||||||
|     PhantomNode startPhantom, targetPhantom; |     PhantomNode startPhantom, targetPhantom; | ||||||
|  | 
 | ||||||
|  |     void BuildRouteSummary(const unsigned distance, const unsigned time); | ||||||
|  | 
 | ||||||
| public: | public: | ||||||
|  |     struct _RouteSummary { | ||||||
|  |         std::string lengthString; | ||||||
|  |         std::string durationString; | ||||||
|  |         unsigned startName; | ||||||
|  |         unsigned destName; | ||||||
|  |         _RouteSummary() : lengthString("0"), durationString("0"), startName(0), destName(0) {} | ||||||
|  |         void BuildDurationAndLengthStrings(unsigned distance, unsigned time) { | ||||||
|  |             //compute distance/duration for route summary
 | ||||||
|  |             std::ostringstream s; | ||||||
|  |             s << 10*(round(distance/10.)); | ||||||
|  |             lengthString = s.str(); | ||||||
|  |             int travelTime = time/10 + 1; | ||||||
|  |             s.str(""); | ||||||
|  |             s << travelTime; | ||||||
|  |             durationString = s.str(); | ||||||
|  |         } | ||||||
|  |     } summary; | ||||||
|  | 
 | ||||||
|     //I know, declaring this public is considered bad. I'm lazy
 |     //I know, declaring this public is considered bad. I'm lazy
 | ||||||
|     std::vector <SegmentInformation> pathDescription; |     std::vector <SegmentInformation> pathDescription; | ||||||
|     DescriptionFactory(); |     DescriptionFactory(); | ||||||
| @ -48,51 +70,7 @@ public: | |||||||
|     void SetStartSegment(const PhantomNode & startPhantom); |     void SetStartSegment(const PhantomNode & startPhantom); | ||||||
|     void SetEndSegment(const PhantomNode & startPhantom); |     void SetEndSegment(const PhantomNode & startPhantom); | ||||||
|     void AppendEncodedPolylineString(std::string & output, bool isEncoded); |     void AppendEncodedPolylineString(std::string & output, bool isEncoded); | ||||||
|     unsigned Run(const unsigned zoomLevel); |     void Run(const unsigned zoomLevel, const unsigned duration); | ||||||
| 
 |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #endif /* DESCRIPTIONFACTORY_H_ */ | #endif /* DESCRIPTIONFACTORY_H_ */ | ||||||
| 
 |  | ||||||
| //private:
 |  | ||||||
| //    void appendInstructionNameToString(const std::string & nameOfStreet, const std::string & instructionOrDirection, std::string &output, bool firstAdvice = false) {
 |  | ||||||
| //        output += "[";
 |  | ||||||
| //        if(config.instructions) {
 |  | ||||||
| //            output += "\"";
 |  | ||||||
| //            if(firstAdvice) {
 |  | ||||||
| //                output += "Head ";
 |  | ||||||
| //            }
 |  | ||||||
| //            output += instructionOrDirection;
 |  | ||||||
| //            output += "\",\"";
 |  | ||||||
| //            output += nameOfStreet;
 |  | ||||||
| //            output += "\",";
 |  | ||||||
| //        }
 |  | ||||||
| //    }
 |  | ||||||
| //
 |  | ||||||
| //    void appendInstructionLengthToString(unsigned length, std::string &output) {
 |  | ||||||
| //        if(config.instructions){
 |  | ||||||
| //            std::string tmpDistance;
 |  | ||||||
| //            intToString(10*(round(length/10.)), tmpDistance);
 |  | ||||||
| //            output += tmpDistance;
 |  | ||||||
| //            output += ",";
 |  | ||||||
| //            intToString(descriptionFactory.startIndexOfGeometry, tmp);
 |  | ||||||
| //            output += tmp;
 |  | ||||||
| //            output += ",";
 |  | ||||||
| //            intToString(descriptionFactory.durationOfInstruction, tmp);
 |  | ||||||
| //            output += tmp;
 |  | ||||||
| //            output += ",";
 |  | ||||||
| //            output += "\"";
 |  | ||||||
| //            output += tmpDistance;
 |  | ||||||
| //            output += "\",";
 |  | ||||||
| //            double angle = descriptionFactory.GetAngleBetweenCoordinates();
 |  | ||||||
| //            DirectionOfInstruction direction;
 |  | ||||||
| //            getDirectionOfInstruction(angle, direction);
 |  | ||||||
| //            output += "\"";
 |  | ||||||
| //            output += direction.shortDirection;
 |  | ||||||
| //            output += "\",";
 |  | ||||||
| //            std::stringstream numberString;
 |  | ||||||
| //            numberString << fixed << setprecision(2) << angle;
 |  | ||||||
| //            output += numberString.str();
 |  | ||||||
| //        }
 |  | ||||||
| //        output += "]";
 |  | ||||||
| //    }
 |  | ||||||
|  | |||||||
| @ -34,7 +34,6 @@ template<class SearchEngineT> | |||||||
| class JSONDescriptor : public BaseDescriptor<SearchEngineT>{ | class JSONDescriptor : public BaseDescriptor<SearchEngineT>{ | ||||||
| private: | private: | ||||||
| 	_DescriptorConfig config; | 	_DescriptorConfig config; | ||||||
| 	_RouteSummary summary; |  | ||||||
| 	DescriptionFactory descriptionFactory; | 	DescriptionFactory descriptionFactory; | ||||||
| 	_Coordinate current; | 	_Coordinate current; | ||||||
| 
 | 
 | ||||||
| @ -51,9 +50,7 @@ public: | |||||||
| 	void Run(http::Reply & reply, RawRouteData &rawRoute, PhantomNodes &phantomNodes, SearchEngineT &sEngine, const unsigned durationOfTrip) { | 	void Run(http::Reply & reply, RawRouteData &rawRoute, PhantomNodes &phantomNodes, SearchEngineT &sEngine, const unsigned durationOfTrip) { | ||||||
| 		WriteHeaderToOutput(reply.content); | 		WriteHeaderToOutput(reply.content); | ||||||
| 		if(durationOfTrip != INT_MAX) { | 		if(durationOfTrip != INT_MAX) { | ||||||
| 			summary.startName = sEngine.GetEscapedNameForNameID(phantomNodes.startPhantom.nodeBasedEdgeNameID); |  | ||||||
| 			descriptionFactory.SetStartSegment(phantomNodes.startPhantom); | 			descriptionFactory.SetStartSegment(phantomNodes.startPhantom); | ||||||
| 			summary.destName = sEngine.GetEscapedNameForNameID(phantomNodes.targetPhantom.nodeBasedEdgeNameID); |  | ||||||
| 			reply.content += "0," | 			reply.content += "0," | ||||||
| 			        "\"status_message\": \"Found route between points\","; | 			        "\"status_message\": \"Found route between points\","; | ||||||
| 
 | 
 | ||||||
| @ -69,20 +66,20 @@ public: | |||||||
| 					"\"status_message\": \"Cannot find route between points\","; | 					"\"status_message\": \"Cannot find route between points\","; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		summary.BuildDurationAndLengthStrings(descriptionFactory.Run(config.z), durationOfTrip); | 		descriptionFactory.Run(config.z, durationOfTrip); | ||||||
| 
 | 
 | ||||||
| 		reply.content += "\"route_summary\": {" | 		reply.content += "\"route_summary\": {" | ||||||
| 				"\"total_distance\":"; | 				"\"total_distance\":"; | ||||||
| 		reply.content += summary.lengthString; | 		reply.content += descriptionFactory.summary.lengthString; | ||||||
| 		reply.content += "," | 		reply.content += "," | ||||||
| 				"\"total_time\":"; | 				"\"total_time\":"; | ||||||
| 		reply.content += summary.durationString; | 		reply.content += descriptionFactory.summary.durationString; | ||||||
| 		reply.content += "," | 		reply.content += "," | ||||||
| 				"\"start_point\":\""; | 				"\"start_point\":\""; | ||||||
| 		reply.content += summary.startName; | 		reply.content += sEngine.GetEscapedNameForNameID(descriptionFactory.summary.startName); | ||||||
| 		reply.content += "\"," | 		reply.content += "\"," | ||||||
| 				"\"end_point\":\""; | 				"\"end_point\":\""; | ||||||
| 		reply.content += summary.destName; | 		reply.content += sEngine.GetEscapedNameForNameID(descriptionFactory.summary.destName); | ||||||
| 		reply.content += "\""; | 		reply.content += "\""; | ||||||
| 		reply.content += "},"; | 		reply.content += "},"; | ||||||
| 		reply.content += "\"route_geometry\": "; | 		reply.content += "\"route_geometry\": "; | ||||||
| @ -135,8 +132,9 @@ public: | |||||||
| 						intToString(segment.duration, tmpDuration); | 						intToString(segment.duration, tmpDuration); | ||||||
| 						reply.content += tmpDuration; | 						reply.content += tmpDuration; | ||||||
| 						reply.content += ",\""; | 						reply.content += ",\""; | ||||||
|  | 						intToString(segment.length, tmpLength); | ||||||
| 						reply.content += tmpLength; | 						reply.content += tmpLength; | ||||||
| 						reply.content += "\",\""; | 						reply.content += "m\",\""; | ||||||
| 						reply.content += Azimuth::Get(segment.bearing); | 						reply.content += Azimuth::Get(segment.bearing); | ||||||
| 						reply.content += "\","; | 						reply.content += "\","; | ||||||
| 						doubleToStringWithTwoDigitsBehindComma(segment.bearing, tmpBearing); | 						doubleToStringWithTwoDigitsBehindComma(segment.bearing, tmpBearing); | ||||||
|  | |||||||
| @ -366,7 +366,7 @@ unsigned readHSGRFromStream(istream &in, vector<NodeT>& nodeList, vector<EdgeT> | |||||||
|     in.read((char*) & numberOfNodes, sizeof(unsigned)); |     in.read((char*) & numberOfNodes, sizeof(unsigned)); | ||||||
|     nodeList.resize(numberOfNodes + 1); |     nodeList.resize(numberOfNodes + 1); | ||||||
|     NodeT currentNode; |     NodeT currentNode; | ||||||
|     for(unsigned nodeCounter = 0; nodeCounter < numberOfNodes; ++nodeCounter ) { |     for(unsigned nodeCounter = 0; nodeCounter <= numberOfNodes; ++nodeCounter ) { | ||||||
|         in.read((char*) ¤tNode, sizeof(NodeT)); |         in.read((char*) ¤tNode, sizeof(NodeT)); | ||||||
|         nodeList[nodeCounter] = currentNode; |         nodeList[nodeCounter] = currentNode; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -197,8 +197,7 @@ int main (int argc, char *argv[]) { | |||||||
|     } |     } | ||||||
|     //Serialize numberOfNodes, nodes
 |     //Serialize numberOfNodes, nodes
 | ||||||
|     edgeOutFile.write((char*) &numberOfNodes, sizeof(unsigned)); |     edgeOutFile.write((char*) &numberOfNodes, sizeof(unsigned)); | ||||||
|     edgeOutFile.write((char*) &_nodes[0], sizeof(StaticGraph<EdgeData>::_StrNode)*(numberOfNodes)); |     edgeOutFile.write((char*) &_nodes[0], sizeof(StaticGraph<EdgeData>::_StrNode)*(numberOfNodes+1)); | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
|     //Serialize number of Edges
 |     //Serialize number of Edges
 | ||||||
|     edgeOutFile.write((char*) &position, sizeof(unsigned)); |     edgeOutFile.write((char*) &position, sizeof(unsigned)); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user