# Program Name: ga_code.py # Description: This is a python implementation of simulated annealing for exam seat planning # Author: Ramazan ÖZKAN # Supervisor: Prof. Rüya ŞAMLI import pandas as pd import numpy as np import random import math #get student-course information from excel def stdcourse_vector(): data = pd.read_excel('students.xlsx') formattedData=[[]] for i in data: tmp=[] for j in data[i]: tmp.append(j) formattedData.append(tmp) return formattedData #get sitting places from excel def sitting_places(): data = pd.read_excel('AdjacencyMatrix.xlsx') sittingPlaces=[[] for i in range(data.size)] for index, row in data[:].iterrows(): sittingPlaces[index]=row return sittingPlaces #first part of the fitness function def ff1(solution): sumSides=0 for i in range(nVars): student=solution[i] course=students[student-1]#[0] side=sittingPlaces[i][3] if side!=-1 and side