Back to index

fet  5.18.0
solution.h
Go to the documentation of this file.
00001 /*
00002 File solution.h
00003 */
00004 
00005 /*
00006 Copyright 2002, 2003 Lalescu Liviu.
00007 
00008 This file is part of FET.
00009 
00010 FET is free software; you can redistribute it and/or modify
00011 it under the terms of the GNU General Public License as published by
00012 the Free Software Foundation; either version 2 of the License, or
00013 (at your option) any later version.
00014 
00015 FET is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with FET; if not, write to the Free Software
00022 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023 */
00024 
00025 #ifndef SOLUTION_H
00026 #define SOLUTION_H
00027 
00028 #include "timetable_defs.h"
00029 
00030 #include "matrix.h"
00031 
00032 #include <QString>
00033 #include <QList>
00034 #include <QTextStream>
00035 
00036 class Rules;
00037 
00041 class Solution{
00042 public:
00043        QList<double> conflictsWeightList;
00044        QList<QString> conflictsDescriptionList;
00045        double conflictsTotal;
00046        
00047        bool teachersMatrixReady;
00048        bool subgroupsMatrixReady;
00049        bool roomsMatrixReady;
00050        
00051        int nPlacedActivities;
00052 
00053        /*
00054        You will need to set this to true if altering the times array values.
00055        The conflicts calculating routine will reset this to false
00056        at the first teachers matrix and subgroups matrix calculation.
00057        */
00058        bool changedForMatrixCalculation;
00059 
00066        qint16 times[MAX_ACTIVITIES];
00067        
00068        qint16 rooms[MAX_ACTIVITIES];
00069 
00076        double _fitness;
00077 
00082        void copy(Rules& r, Solution& c);
00083 
00087        void init(Rules& r);
00088 
00093        void makeUnallocated(Rules& r);
00094 
00101        double fitness(Rules& r, QString* conflictsString=NULL);
00102 
00103        void getTeachersTimetable(Rules& r, Matrix3D<qint16>& a, Matrix3D<QList<qint16> >& b);
00104        //return value is the number of conflicts, which must be 0
00105 
00106        void getSubgroupsTimetable(Rules& r, Matrix3D<qint16>& a);
00107        //return value is the number of conflicts, which must be 0
00108 
00109        void getRoomsTimetable(Rules& r, Matrix3D<qint16>& a);
00110        //return value is the number of conflicts, which must be 0
00111 
00112        int getSubgroupsMatrix(Rules& r, Matrix3D<qint8>& a);
00113 
00114        int getTeachersMatrix(Rules& r, Matrix3D<qint8>& a);
00115 
00116        int getRoomsMatrix(Rules& r, Matrix3D<qint8>& a);
00117 };
00118 
00119 #endif