import Solution as solution
from Business.Query import Query
from Business.RAM import RAM
from Business.Disk import Disk

if __name__ == '__main__':
    solution.dropTables()
    # solution.createTables()
    # i = solution.addQuery(Query(3, "check", 6))
    # i = solution.deleteQuery(Query(2, "check", 6))
    # print(i)
    # q = solution.getQueryProfile(3)
    # print(q.getQueryID(), q.getPurpose(), q.getSize())
    # print(i)
    # i = solution.deleteQuery(Query(5, "H", 3))
    # print(i)
    # i = solution.deleteQuery(Query(3, "check", 1))
    # q = solution.getQueryProfile(3)
    # print(q.getQueryID(), q.getPurpose(), q.getSize())
    # solution.addQuery(Query(3, "check", 1))
    # i = solution.addDiskAndQuery(Disk(1, "h", 1, 5, 1), Query(2, "check", 1))
    # solution.addDisk(Disk(2, "h", 1, 5, 1))
    # print(i)
    # solution.getDiskProfile(1)
    # solution.getQueryProfile(2)
    # solution.clearTables()
    # solution.addDisk(Disk(1, "h", 1, 1, 1))
    # solution.getDiskProfile(1)
    # solution.addDisk(Disk(2, "h", 1, 1, 1))
    # solution.getDiskProfile(2)
    # solution.addQuery(Query(3, "check", 1))
    # i = solution.addDiskAndQuery(Disk(1, "h", 1, 1, 1), Query(2, "check", 1))
    # solution.getDiskProfile(1)
    # solution.getQueryProfile(2)
    # solution.addQueryToDisk(Query(3, "check", 2), 1)
    # solution.addQueryToDisk(Query(3, "check", 1), 2)
    # solution.addQuery(Query(3, 'check', 6))
    # solution.addQuery(Query(1, 'check', 3))
    # solution.addQuery(Query(2, 'check', 10))
    # solution.addQuery(Query(4, 'check', 2))
    # solution.addQuery(Query(5, 'check', 2))
    # solution.addQuery(Query(6, 'check', 8))
    # solution.addQuery(Query(7, 'check', 2))
    # solution.addQuery(Query(8, 'check', 34))
    # solution.addDisk(Disk(2, 'check', 1, 20, 2))
    # solution.addDisk(Disk(5, 'check2', 2, 20, 3))
    # solution.addQueryToDisk(Query(3, 'check', 6), 2)
    # solution.addQueryToDisk(Query(4, 'check', 2), 2)
    # solution.addQueryToDisk(Query(2, 'check', 10), 5)
    # solution.addQueryToDisk(Query(6, 'check', 8), 2)
    # solution.addRAM(RAM(1, "check", 2))
    # solution.addRAM(RAM(2, "check", 1))
    # solution.addRAMToDisk(1, 2)
    # solution.addRAMToDisk(2, 2)
    # f = solution.diskTotalRAM(1)
    # f = solution.averageSizeQueriesOnDisk(2)
    # print(f)
    # solution.getCostForPurpose('check')
    # l = solution.getQueriesCanBeAddedToDiskAndRAM(2)
    # print(l)
    # print(solution.isCompanyExclusive(1))
    # print(solution.getConflictingDisks())
    # print(solution.mostAvailableDisks())
    # solution.addQuery(Query(3, 'q3', 6))
    # solution.addQuery(Query(1, 'q1', 3))
    # solution.addQuery(Query(2, 'q2', 1))
    # solution.addQuery(Query(4, 'q4', 2))
    # solution.addQuery(Query(8, 'q8', 34))
    # solution.addDisk(Disk(2, 'disk2', 1, 20, 2))
    # solution.addDisk(Disk(5, 'disk5', 2, 20, 3))
    # solution.addDisk(Disk(7, 'disk7', 2, 20, 6))
    # solution.addQueryToDisk(Query(3, 'q3', 6), 2)
    # solution.addQueryToDisk(Query(3, 'q3', 6), 5)
    # solution.addQueryToDisk(Query(3, 'q3', 6), 7)
    # solution.addQueryToDisk(Query(2, 'q2', 1), 5)
    # print(solution.mostAvailableDisks())
    # solution.deleteQuery(Query(2, 'q2', 1))
    # solution.addRAM(RAM(1, "r1", 10))
    # solution.addRAM(RAM(2, "r2", 6))
    # solution.addRAMToDisk(1, 2)
    # solution.addRAMToDisk(2, 2)
    # solution.addQueryToDisk(Query(2, 'q2', 1), 7)
    # solution.addQueryToDisk(Query(1, 'q1', 3), 2)
    # solution.addQueryToDisk(Query(1, 'q1', 3), 7)
    # solution.addQueryToDisk(Query(4, 'q4', 2), 5)
    # print(solution.getQueriesCanBeAddedToDiskAndRAM(2))
    # print(solution.getQueriesCanBeAddedToDisk(2))
    # solution.addDisk(Disk(2, 'check', 1, 20, 2))
    # print(solution.addQuery(Query(1, "stuff", 0)))
    # solution.addQueryToDisk(Query(1, "stuff", 0), 2)
    # print(solution.getCloseQueries(1))
    # print(solution.addQuery(Query(2, "stuff", 0)))
    # solution.addQueryToDisk(Query(2, "stuff", 0), 2)
    # print(solution.getCloseQueries(1))
    # print(solution.getCloseQueries(2))

    # print(solution.mostAvailableDisks(), "No disks")
    # print(solution.addDisk(Disk(1, "HP", 1, 1, 1)), "Should work")
    # print(solution.mostAvailableDisks(), "Can run 0 queries")



