Click here to Skip to main content
15,927,347 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: GetParent Pin
David Crow18-Jul-08 10:17
David Crow18-Jul-08 10:17 
QuestionNetwork Programing Question. Pin
CresShadow17-Jul-08 14:54
CresShadow17-Jul-08 14:54 
AnswerRe: Network Programing Question. Pin
David Crow17-Jul-08 16:00
David Crow17-Jul-08 16:00 
AnswerRe: Network Programing Question. Pin
led mike17-Jul-08 18:46
led mike17-Jul-08 18:46 
JokeRe: Network Programing Question. Pin
CPallini17-Jul-08 21:40
mveCPallini17-Jul-08 21:40 
GeneralRe: Network Programing Question. Pin
CresShadow19-Jul-08 6:30
CresShadow19-Jul-08 6:30 
GeneralRe: Network Programing Question. Pin
led mike21-Jul-08 5:43
led mike21-Jul-08 5:43 
QuestionMaze Search in C++ Pin
Roppa17-Jul-08 13:24
Roppa17-Jul-08 13:24 
Hi Guys,

I'm not much of a programmer, so bear with me please.

I'm trying to program a standard Ant Algorithm/Ant Colony Optimization in C++, to search through a basic maze of open and closed (1 for open, 0 for closed) nodes to simulate a basic network.

Now I have the program functioning correctly for one ant, just runs through it once until its had its maximum number of moves or it finds the destination node.

I am trying to convert this into a class, so I can have multiple instances of the class (multiple ants) going through the network at once. My question is; how do I accomplish something like this? Currently, for my Ant Class I have :

class ant {

coordStruct route[300];
pheremoneStruct location[1];

public:
void set_route (int,int);
void set_location (int,int);
void set_coordPheremone (int,int,int);
} ant;


Will this work? If I perform all of the calculations and such outside of the class via get/set functions? or should I move the actual methods themselves into the class like below?

class ant {

coordStruct route[300];
pheremoneStruct location[1];

/* CALCULATIONS TO DETERMINE NEXT MOVE HERE */

public:
void set_route (int,int);
void set_location (int,int);
void set_coordPheremone (int,int,int);
} ant;



I hope I've explained this clearly... But any help is appreciated, or any links to the code of something similar to give me an idea of what to do would also be helpful!


Thanks a lot.

Roppa Sniff | :^)
AnswerRe: Maze Search in C++ Pin
enhzflep17-Jul-08 18:08
enhzflep17-Jul-08 18:08 
QuestionRe: Maze Search in C++ Pin
Roppa17-Jul-08 23:36
Roppa17-Jul-08 23:36 
AnswerRe: Maze Search in C++ Pin
enhzflep18-Jul-08 16:42
enhzflep18-Jul-08 16:42 
GeneralRe: Maze Search in C++ Pin
Roppa21-Jul-08 8:32
Roppa21-Jul-08 8:32 
QuestionIs anyone using RFID reader here? Pin
includeh1017-Jul-08 9:52
includeh1017-Jul-08 9:52 
AnswerRe: Is anyone using RFID reader here? Pin
ThatsAlok17-Jul-08 21:57
ThatsAlok17-Jul-08 21:57 
QuestionHow to create a HashTable in C++? Pin
includeh1017-Jul-08 9:36
includeh1017-Jul-08 9:36 
AnswerRe: How to create a HashTable in C++? Pin
JudyL_MD17-Jul-08 10:08
JudyL_MD17-Jul-08 10:08 
AnswerRe: How to create a HashTable in C++? Pin
Budric B.17-Jul-08 10:08
Budric B.17-Jul-08 10:08 
AnswerRe: How to create a HashTable in C++? Pin
David Crow17-Jul-08 16:02
David Crow17-Jul-08 16:02 
GeneralRe: How to create a HashTable in C++? Pin
led mike17-Jul-08 18:08
led mike17-Jul-08 18:08 
GeneralRe: How to create a HashTable in C++? Pin
ThatsAlok18-Jul-08 1:47
ThatsAlok18-Jul-08 1:47 
GeneralRe: How to create a HashTable in C++? Pin
David Crow18-Jul-08 9:02
David Crow18-Jul-08 9:02 
QuestionOleRun in COleDispatchDriver::CreateDispatch returns REGDB_E_CLASSNOTREG Pin
Kevin 123341217-Jul-08 8:35
Kevin 123341217-Jul-08 8:35 
AnswerRe: OleRun in COleDispatchDriver::CreateDispatch returns REGDB_E_CLASSNOTREG Pin
led mike17-Jul-08 18:20
led mike17-Jul-08 18:20 
QuestionMSVC++ 2005, Project Dependancies and unresolved externals [modified] Pin
Budric B.17-Jul-08 6:36
Budric B.17-Jul-08 6:36 
AnswerRe: MSVC++ 2005, Project Dependancies and unresolved externals Pin
Mark Salsbery17-Jul-08 7:28
Mark Salsbery17-Jul-08 7:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.