Exemple #1
0
        if swaps != 0:
            swap_str = "swap_" + str(itetation)
            columns[swap_str + " ids"] = swaps_id
            columns[swap_str] = []
            columns[swap_str + " index"] = []
            for student in students:
                columns[swap_str].append(student.assignment)
                columns[swap_str + " index"].append(student.__getattribute__(priority_type).index(student.assignment))

    return students


if __name__ == "__main__":
    hospital_codes = data.get_codes("res/hospitals codes.txt")
    results_codes = data.get_codes("res/results codes.txt")
    students = data.get_all_students(hospital_codes, results_codes)
    priority_type = 'real'

    students, columns, results_before, seats = preprocess(students, priority_type)

    for name in hospital_codes.values():
        if name not in set(seats.names):
            seats[name] = 0
    order = get_hospitals_order(seats)

    # uncomment this to activate the linear programing solver
    # students = SwapProblem(seats, order, students).solve()

    students = find_simple_swaps(students, priority_type, columns)
    results_after = []
    # uncomment this to activate the linear programing solver
Exemple #2
0
from flask_restplus import reqparse
import data

student_args = reqparse.RequestParser()
student_args.add_argument('stu_num', type=int, required=True)
student_args.add_argument('first_name', type=str, required=True)
student_args.add_argument('last_name', type=str, required=True)
student_args.add_argument('address', type=str, required=True)
student_args.add_argument('city', type=str, required=True)
student_args.add_argument('credits', type=int, required=True)
student_args.add_argument('gpa', type=float, required=True)

dept_args = reqparse.RequestParser()
dept_args.add_argument('dept_num',
                       type=str,
                       required=True,
                       choices=data.get_all_depts())

specific_student = reqparse.RequestParser()
specific_student.add_argument('stu_num_manual', type=int, required=False)
specific_student.add_argument('stu_num',
                              type=str,
                              required=False,
                              choices=data.get_all_students())

specific_faculty = reqparse.RequestParser()
specific_faculty.add_argument('fac_num', type=int, required=True)