public Ant(TimeTableData problemData, MMASData mmasData, int week)
 {
     // memeber variables initialization
     data = problemData;
     solution = new Solution(problemData, week);
     events = data.GetWeekEvents(week);
     eventsCount = events.Length;
     this.mmasData = mmasData;
     totalTimeSlots = data.TotalTimeSlots;
 }
        public MMASData(TimeTableData problemData, int week, double evaporation, double minPher)
        {
            //member variables initialization
            data = problemData;
            events = data.GetWeekEvents(week);
            eventesNumber = events.Length;
            timeslotsNumber = problemData.TotalTimeSlots;
            Pheromones = new double[eventesNumber, timeslotsNumber];
            EvaporationRate = evaporation;
            MinPherLevel = minPher;

            if (EvaporationRate < 1.0)
            {
                MaxPherLevel = 10.0 / (1.0 - EvaporationRate);
            }
            else
            {
                MaxPherLevel = int.MaxValue;
            }

            // creating a set of pre-sorted event lists
            // sorting events based on level of correlations
            int[] event_correlation = new int[eventesNumber];
            for (int i = 0; i < eventesNumber; i++)
            {
                // summing up the correlations for each event
                event_correlation[i] = 0;
                for (int j = 0; j < eventesNumber; j++)
                {
                    if (problemData.ConflictingEvents(events[i].Id, events[j].Id))
                        event_correlation[i] += 1;
                }
            }

            SortedEventList = new int[eventesNumber];
            for (int i = 0; i < eventesNumber; i++)
            {
                // sorting the list
                int max_correlation = -1;
                int event_index = -1;
                for (int j = 0; j < eventesNumber; j++)
                {
                    if (event_correlation[j] > max_correlation)
                    {
                        max_correlation = event_correlation[j];
                        event_index = j;
                    }
                }

                event_correlation[event_index] = -2;
                SortedEventList[i] = event_index;
            }
        }