In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "VC++6.0 code compilation example analysis". The explanation content in this article is simple and clear, easy to learn and understand. Please follow the idea of Xiaobian slowly and deeply to study and learn "VC++6.0 code compilation example analysis" together.
VC++6.0 code is as follows:
public: void addcity(int city); int tabu[iCityCount]; void Clear(); void UpdateResult(); double m_dLength; double m_dShortest; void move(); ant(); void move2last(); }; void ant::move2last() { int i; for(i=0;i《iCityCount;i++) if (AllowedCity[i]==1) { addcity(i); break; } } void ant::Clear() { m_dLength=0; int i; for(i=0; i〈iCityCount;i++) prob[i]=0; AllowedCity[i]=1; } i=tabu[iCityCount-1]; m_iCityCount=0; addcity(i); } ant::ant() { m_dLength=m_dShortest=0; m_iCityCount=0; int i; for(i=0;i〈iCityCount;i++) AllowedCity[i]=1; prob[i]=0; } } void ant::addcity(int city) { //add city to tabu; tabu[m_iCityCount]=city; m_iCityCount++; AllowedCity[city]=0; } int ant::ChooseNextCity() { //Update the probability of path selection //select a path from tabu[m_iCityCount-1] to next int i; int j=10000; double temp=0; int curCity=tabu[m_iCityCount-1]; for (i=0;i〈iCityCount;i++) if((AllowedCity[i]==1)) { temp+=pow((1.0/Map.distance[curCity][i]),beta)*pow((Map.m_dTrial[curCity][i]),alpha); } }
The above is an example of VC++6.0 code, you can modify the number of cycles and other parameters. To get a better solution. When using TSP data, delete some of the previous string information, leaving only coordinate data.
Thank you for reading, the above is the "VC++6.0 code preparation example analysis" content, after the study of this article, I believe that we have a deeper understanding of VC++6.0 code preparation example analysis this problem, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.