質問があります:
Python で ANT アルゴリズムをプログラミングしようとしていますが、C++ のコードがあり、この部分のプログラミング方法がわかりません。
typedef struct {
int x;
int y;
} cityType;
typedef struct {
int curCity;
int nextCity;
//MAX_CITIES
unsigned char tabu[15];
int pathIndex;
//MAX_CITIES
unsigned char path[15];
double tourLength;
} antType;
私はこれをプログラムしていますが、よくわかりません
class CityType:
def __init__(self):
self.x = arange(MAX_CITIES)
self.y = arange(MAX_CITIES)
# Class AntType
class AntType:
def __init__(self):
self.curCity = arange(MAX_ANTS)
self.nextCity = arange(MAX_ANTS)
self.tabu = arange(MAX_ANTS)
self.pathIndex = arange(MAX_ANTS)
self.path = arange(MAX_ANTS)
self.tourLength = arange(MAX_ANTS)
ありがとう