'''
Created on 22 Sep 2015

@author: pedroribeiro
'''

import Experiment
from Experiment import Methods

DEADLOCK_PROPERTY = ":[deadlock free [F]]"
SUBLOCK_PROPERTY = ":[sublock free [F]]" 

DEADLOCK_METHODS = [Methods.SDD, Methods.Pair, Methods.PairPicking, Methods.DFinderPM, Methods.DFinderFP, Methods.DFinderLinear,
            Methods.FDR, Methods.FDR_C, Methods.FDR_POR]

SUBLOCK_METHODS = [Methods.Pair, Methods.PairPicking]

EXPERIMENTS = [\
        ["ABP", "abp", [10,30,50,70], [Methods.FDR_C, Methods.PairPicking,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["ButID", "butler_identity_distributed", [3,5,7,10], [Methods.PairPicking,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["ButID2", "butler_identity_distributed2", [3,5,10,50], [Methods.PairPicking,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["ButI", "butler_identity", [3,5,10,15], [Methods.PairPicking,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["Lock", "lockd", [50,100,200,500], [Methods.FDR_C, Methods.PairPicking,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["Phils", "philsc", [50,100,200,500], [Methods.PairPicking,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["Ray", "raymondsd", [10,25,50,100], [Methods.FDR_C, Methods.PairPicking,Methods.FSDD, Methods.CSDD,Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["SWP", "swpc", [3,4,5,6], [Methods.PairPicking,Methods.FSDD, Methods.CSDD,Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["Tarry", "tarrys", [5,8,12,15], [Methods.FDR_C, Methods.PairPicking,Methods.FSDD, Methods.CSDD,Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["Tel", "teleph", [4,6,8,10], [Methods.PairPicking,Methods.FSDD, Methods.CSDD, Methods.PairStaticSMT,Methods.PairStatic, Methods.PairToken, Methods.PairTokenSMT]],
        ["VirtRoute", "virtroute", [5,10,20,30], [Methods.PairPicking,Methods.FSDD, Methods.CSDD,Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["VChain4", "routing_chain_m4", [10,20,30,40], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["VGrid4", "routing_grid_m4", [10,20,30,40], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["VFully4", "routing_fully_m4", [5,8,12,15], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["VChain5", "routing_chain_m5", [10,20,30,40], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["VGrid5", "routing_grid_m5", [10,20,30,40], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["VFully5", "routing_fully_m5", [5,8,12,15], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["VChain6", "routing_chain_m6", [10,20,30,40], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["VGrid6", "routing_grid_m6", [10,20,30,40], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["VFully6", "routing_fully_m6", [5,8,12,15], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["PChain4", "routing_priority_chain_m4", [5,10,15,20], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["PGrid4", "routing_priority_grid_m4", [5,10,15,20], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["PFully4", "routing_priority_fully_m4", [3,5,8,12], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["PChain5", "routing_priority_chain_m5", [5,10,15,20], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["PGrid5", "routing_priority_grid_m5", [5,10,15,20], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["PFully5", "routing_priority_fully_m5", [3,5,8,12], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["PChain6", "routing_priority_chain_m6", [5,10,15,20], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["PGrid6", "routing_priority_grid_m6", [5,10,15,20], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
        ["PFully6", "routing_priority_fully_m6", [3,5,8,12], [Methods.Pair, Methods.SDD,Methods.FSDD, Methods.CSDD, Methods.PairStatic, Methods.PairStaticSMT, Methods.PairToken, Methods.PairTokenSMT]],
    ]

if __name__ == '__main__':
    
    Experiment.run("ExpsDead", "Templates/Deadlock", DEADLOCK_METHODS, DEADLOCK_PROPERTY , EXPERIMENTS, True, True, True)
    Experiment.run("ExpsSub", "Templates/Deadlock", SUBLOCK_METHODS, SUBLOCK_PROPERTY , EXPERIMENTS, True, True, True)
    
