⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 courseclass.h

📁 遗传算法的四个源程序和源代码
💻 H
字号:

/*
 * 
 * website: http://www.coolsoft-sd.com/
 * contact: support@coolsoft-sd.com
 *
 */

/*
 * Genetic Algorithm Library
 * Copyright (C) 2007-2008 Coolsoft Software Development
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 */

#include <list>
#include "Professor.h"
#include "StudentsGroup.h"
#include "Course.h"

#pragma once

using namespace std;

// Stores data about single class
class CourseClass
{

private:

	// Profesor who teaches
	Professor* _professor;

	// Course to which class belongs
	Course* _course;

	// Student groups who attend class
	list<StudentsGroup*> _groups;

	// Number of seats (students) required in room
	int _numberOfSeats;

	// Initicates wheather class requires computers
	bool _requiresLab;

	// Duration of class in hours
	int _duration;
	
public:

	// Initializes class object
	CourseClass(Professor* professor, Course* course, const list<StudentsGroup*>& groups,
		bool requiresLab, int duration);

	// Frees used memory
	~CourseClass();

	// Returns TRUE if another class has one or overlapping student groups.
	bool GroupsOverlap(const CourseClass& c ) const;

	// Returns TRUE if another class has same professor.
	inline bool ProfessorOverlaps(const CourseClass& c ) const { return *_professor == *c._professor; }

	// Return pointer to professor who teaches
	inline const Professor& GetProfessor() const { return *_professor; }

	// Return pointer to course to which class belongs
	inline const Course& GetCourse() const { return *_course; }

	// Returns reference to list of student groups who attend class
	inline const list<StudentsGroup*>& GetGroups() const { return _groups; }

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

	// Returns TRUE if class requires computers in room.
	inline bool IsLabRequired() const { return _requiresLab; }

	// Returns duration of class in hours
	inline int GetDuration() const { return _duration; }

};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -