Click here to Skip to main content
15,892,517 members
Articles / Desktop Programming / MFC

Genetic Algorithm Library

Rate me:
Please Sign up or sign in to vote.
4.93/5 (175 votes)
7 Apr 2012GPL358 min read 439.2K   34.7K   555  
A framework for genetic algorithms
/*
 * 
 * website: http://www.coolsoft-sd.com/
 * contact: support@coolsoft-sd.com
 *
 */

#include <string>

#pragma once

using namespace std;

// Stores data about classroom
class Room
{

private:

	// ID counter used to assign IDs automatically
	static int _nextRoomId;

private:

	// Room ID - automatically assigned
	int _id;

	// Room name
	string _name;

	// Inidicates if room has computers
	bool _lab;

	// Number of seats in room
	int _numberOfSeats;

public:

	// Initializes room data and assign ID to room
	Room(const string& name, bool lab, int numberOfSeats);

	// Returns room ID
	inline int GetId() const { return _id; }

	// Returns name
	inline const string& GetName() const { return _name; }

	// Returns TRUE if room has computers otherwise it returns FALSE
	inline bool IsLab() const { return _lab; }

	// Returns number of seats in room
	inline int GetNumberOfSeats() const { return _numberOfSeats; }

	// Restarts ID assigments
	static inline void RestartIDs() { _nextRoomId = 0; }

};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer
Serbia Serbia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions