コード例 #1
0
ファイル: sip.py プロジェクト: okamumu/relpy
def ftree_CLUSTER(BLADE, CM, appserver, nic, proxy, switch):
    CM1 = relpy.FTEvent(env.bdd, CM)
    CM2 = relpy.FTEvent(env.bdd, CM)
    esw1 = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(switch)))
    esw2 = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(switch)))
    esw3 = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(switch)))
    esw4 = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(switch)))
    SW = relpy.FTBasicEvent(env.bdd,
                            (relpy.Const(1) - relpy.CTMCExrss(appserver)))
    SWP = relpy.FTBasicEvent(env.bdd,
                             (relpy.Const(1) - relpy.CTMCExrss(proxy)))
    Node_A = relpy.FTEvent(env.bdd, BLADE)
    nic1_A = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    nic2_A = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    eth1_A = relpy.FTOrGate([nic1_A, esw1])
    eth2_A = relpy.FTOrGate([nic2_A, esw2])
    eth_A = relpy.FTAndGate([eth1_A, eth2_A])
    BS_A = relpy.FTOrGate([Node_A, eth_A])
    Node_B = relpy.FTEvent(env.bdd, BLADE)
    nic1_B = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    nic2_B = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    eth1_B = relpy.FTOrGate([nic1_B, esw1])
    eth2_B = relpy.FTOrGate([nic2_B, esw2])
    eth_B = relpy.FTAndGate([eth1_B, eth2_B])
    BS_B = relpy.FTOrGate([Node_B, eth_B])
    Node_C = relpy.FTEvent(env.bdd, BLADE)
    nic1_C = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    nic2_C = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    eth1_C = relpy.FTOrGate([nic1_C, esw1])
    eth2_C = relpy.FTOrGate([nic2_C, esw2])
    eth_C = relpy.FTAndGate([eth1_C, eth2_C])
    BS_C = relpy.FTOrGate([Node_C, eth_C])
    Node_D = relpy.FTEvent(env.bdd, BLADE)
    nic1_D = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    nic2_D = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    eth1_D = relpy.FTOrGate([nic1_D, esw3])
    eth2_D = relpy.FTOrGate([nic2_D, esw4])
    eth_D = relpy.FTAndGate([eth1_D, eth2_D])
    BS_D = relpy.FTOrGate([Node_D, eth_D])
    Node_E = relpy.FTEvent(env.bdd, BLADE)
    nic1_E = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    nic2_E = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    eth1_E = relpy.FTOrGate([nic1_E, esw3])
    eth2_E = relpy.FTOrGate([nic2_E, esw4])
    eth_E = relpy.FTAndGate([eth1_E, eth2_E])
    BS_E = relpy.FTOrGate([Node_E, eth_E])
    Node_F = relpy.FTEvent(env.bdd, BLADE)
    nic1_F = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    nic2_F = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    eth1_F = relpy.FTOrGate([nic1_F, esw3])
    eth2_F = relpy.FTOrGate([nic2_F, esw4])
    eth_F = relpy.FTAndGate([eth1_F, eth2_F])
    BS_F = relpy.FTOrGate([Node_F, eth_F])
    Node_G = relpy.FTEvent(env.bdd, BLADE)
    nic1_G = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    nic2_G = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    eth1_G = relpy.FTOrGate([nic1_G, esw1])
    eth2_G = relpy.FTOrGate([nic2_G, esw2])
    eth_G = relpy.FTAndGate([eth1_G, eth2_G])
    BS_G = relpy.FTOrGate([Node_G, eth_G])
    Node_H = relpy.FTEvent(env.bdd, BLADE)
    nic1_H = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    nic2_H = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(nic)))
    eth1_H = relpy.FTOrGate([nic1_H, esw3])
    eth2_H = relpy.FTOrGate([nic2_H, esw4])
    eth_H = relpy.FTAndGate([eth1_H, eth2_H])
    BS_H = relpy.FTOrGate([Node_H, eth_H])
    AS1 = relpy.FTOrGate([SW, BS_A, CM1])
    AS2 = relpy.FTOrGate([SW, BS_A, CM1])
    AS3 = relpy.FTOrGate([SW, BS_B, CM1])
    AS4 = relpy.FTOrGate([SW, BS_B, CM1])
    AS5 = relpy.FTOrGate([SW, BS_C, CM1])
    AS6 = relpy.FTOrGate([SW, BS_C, CM1])
    AS7 = relpy.FTOrGate([SW, BS_D, CM2])
    AS8 = relpy.FTOrGate([SW, BS_D, CM2])
    AS9 = relpy.FTOrGate([SW, BS_E, CM2])
    AS10 = relpy.FTOrGate([SW, BS_E, CM2])
    AS11 = relpy.FTOrGate([SW, BS_F, CM2])
    AS12 = relpy.FTOrGate([SW, BS_F, CM2])
    apps = relpy.FTKofnGate(
        relpy.Const(6).eval(env),
        relpy.Const(12).eval(env),
        [AS1, AS2, AS3, AS4, AS5, AS6, AS7, AS8, AS9, AS10, AS11, AS12])
    PX1 = relpy.FTOrGate([SWP, BS_G, CM1])
    PX2 = relpy.FTOrGate([SWP, BS_H, CM2])
    pxys = relpy.FTAndGate([PX1, PX2])
    top = relpy.FTOrGate([apps, pxys])
    return top
コード例 #2
0
ファイル: sip.py プロジェクト: okamumu/relpy
def ftree_CM(cooling, midplane, power):
    MP = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(midplane)))
    Cool = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(cooling)))
    Pwr = relpy.FTEvent(env.bdd, (relpy.Const(1) - relpy.CTMCExrss(power)))
    top = relpy.FTOrGate([MP, Cool, Pwr])
    return top
コード例 #3
0
ファイル: sip.py プロジェクト: okamumu/relpy
def bind_u_nic(f_nic, nic):
    return (f_nic / (relpy.Const(1) - relpy.CTMCExrss(nic)))
コード例 #4
0
ファイル: sip.py プロジェクト: okamumu/relpy
def bind_u_esw(f_esw, switch):
    return (f_esw / (relpy.Const(1) - relpy.CTMCExrss(switch)))
コード例 #5
0
ファイル: sip.py プロジェクト: okamumu/relpy
def ctmc_pxy_pairup(pxy_b, pxy_beta_m, pxy_c, pxy_d, pxy_delta1, pxy_delta2,
                    pxy_delta_m, pxy_e, pxy_gamma, pxy_mu, pxy_phi, pxy_q,
                    pxy_r, pxy_rou_a, pxy_rou_m):
    pxy_pairup = relpy.CTMC("pxy_pairup")
    pxy_pairup.add_trans("2U", "UO", (relpy.Const(2) * pxy_gamma))
    pxy_pairup.add_trans("UO", "1D", (pxy_d * pxy_delta1))
    pxy_pairup.add_trans("UO", "2D", (pxy_e * pxy_delta2))
    pxy_pairup.add_trans("UO", "1N", ((relpy.Const(1) - pxy_d) * pxy_delta1))
    pxy_pairup.add_trans("1N", "2D", (pxy_e * pxy_delta2))
    pxy_pairup.add_trans("1N", "UN", ((relpy.Const(1) - pxy_e) * pxy_delta2))
    pxy_pairup.add_trans("UO", "2N", ((relpy.Const(1) - pxy_e) * pxy_delta2))
    pxy_pairup.add_trans("2N", "UN", ((relpy.Const(1) - pxy_d) * pxy_delta1))
    pxy_pairup.add_trans("2N", "1D2N", (pxy_d * pxy_delta1))
    pxy_pairup.add_trans("1D", "SO", (pxy_c * pxy_phi))
    pxy_pairup.add_trans("1D", "SN", ((relpy.Const(1) - pxy_c) * pxy_phi))
    pxy_pairup.add_trans("SO", "UA", (pxy_e * pxy_delta2))
    pxy_pairup.add_trans("SO", "UR", ((relpy.Const(1) - pxy_e) * pxy_delta2))
    pxy_pairup.add_trans("SN", "UC", (pxy_e * pxy_delta2))
    pxy_pairup.add_trans("SN", "US", ((relpy.Const(1) - pxy_e) * pxy_delta2))
    pxy_pairup.add_trans("2D", "1D2D", pxy_delta1)
    pxy_pairup.add_trans("1D2D", "UA", (pxy_c * pxy_phi))
    pxy_pairup.add_trans("1D2D", "UC", ((relpy.Const(1) - pxy_c) * pxy_phi))
    pxy_pairup.add_trans("UA", "UR", ((relpy.Const(1) - pxy_q) * pxy_rou_a))
    pxy_pairup.add_trans("UA", "2U", (pxy_q * pxy_rou_a))
    pxy_pairup.add_trans("UR", "2U", (pxy_r * pxy_rou_m))
    pxy_pairup.add_trans("UR", "UB", ((relpy.Const(1) - pxy_r) * pxy_rou_m))
    pxy_pairup.add_trans("UB", "2U", pxy_beta_m)
    pxy_pairup.add_trans("UC", "US", ((relpy.Const(1) - pxy_q) * pxy_rou_a))
    pxy_pairup.add_trans("UC", "2U", (pxy_q * pxy_rou_a))
    pxy_pairup.add_trans("US", "2U", (pxy_r * pxy_rou_m))
    pxy_pairup.add_trans("US", "UT", ((relpy.Const(1) - pxy_r) * pxy_rou_m))
    pxy_pairup.add_trans("UT", "2U", (pxy_b * pxy_beta_m))
    pxy_pairup.add_trans("UT", "RP", ((relpy.Const(1) - pxy_b) * pxy_beta_m))
    pxy_pairup.add_trans("RP", "2U", pxy_mu)
    pxy_pairup.add_trans("UN", "MD", pxy_delta_m)
    pxy_pairup.add_trans("MD", "1D2N", pxy_delta1)
    pxy_pairup.add_trans("1D2N", "UR", (pxy_c * pxy_phi))
    pxy_pairup.add_trans("1D2N", "US", ((relpy.Const(1) - pxy_c) * pxy_phi))
    pxy_pairup.add_init("2U", relpy.Const(1))
    return pxy_pairup
コード例 #6
0
ファイル: sip.py プロジェクト: okamumu/relpy
def ctmc_pairup(b, beta_m, c, d, delta1, delta2, delta_m, e, gamma, mu, phi, q,
                r, rou_a, rou_m):
    pairup = relpy.CTMC("pairup")
    pairup.add_trans("2U", "UO", (relpy.Const(2) * gamma))
    pairup.add_trans("UO", "1D", (d * delta1))
    pairup.add_trans("UO", "2D", (e * delta2))
    pairup.add_trans("UO", "1N", ((relpy.Const(1) - d) * delta1))
    pairup.add_trans("1N", "2D", (e * delta2))
    pairup.add_trans("1N", "UN", ((relpy.Const(1) - e) * delta2))
    pairup.add_trans("UO", "2N", ((relpy.Const(1) - e) * delta2))
    pairup.add_trans("2N", "UN", ((relpy.Const(1) - d) * delta1))
    pairup.add_trans("2N", "1D2N", (d * delta1))
    pairup.add_trans("1D", "FS", (c * phi))
    pairup.add_trans("1D", "FN", ((relpy.Const(1) - c) * phi))
    pairup.add_trans("S", "UA", (e * delta2))
    pairup.add_trans("S", "UR", ((relpy.Const(1) - e) * delta2))
    pairup.add_trans("N", "UC", (e * delta2))
    pairup.add_trans("N", "US", ((relpy.Const(1) - e) * delta2))
    pairup.add_trans("2D", "1D2D", delta1)
    pairup.add_trans("1D2D", "UA", (c * phi))
    pairup.add_trans("1D2D", "UC", ((relpy.Const(1) - c) * phi))
    pairup.add_trans("UA", "UR", ((relpy.Const(1) - q) * rou_a))
    pairup.add_trans("UA", "2U", (q * rou_a))
    pairup.add_trans("UR", "2U", (r * rou_m))
    pairup.add_trans("UR", "UB", ((relpy.Const(1) - r) * rou_m))
    pairup.add_trans("UB", "2U", beta_m)
    pairup.add_trans("UC", "US", ((relpy.Const(1) - q) * rou_a))
    pairup.add_trans("UC", "2U", (q * rou_a))
    pairup.add_trans("US", "2U", (r * rou_m))
    pairup.add_trans("US", "UT", ((relpy.Const(1) - r) * rou_m))
    pairup.add_trans("UT", "2U", (b * beta_m))
    pairup.add_trans("UT", "RP", ((relpy.Const(1) - b) * beta_m))
    pairup.add_trans("RP", "2U", mu)
    pairup.add_trans("UN", "MD", delta_m)
    pairup.add_trans("MD", "1D2N", delta1)
    pairup.add_trans("1D2N", "UR", (c * phi))
    pairup.add_trans("1D2N", "US", ((relpy.Const(1) - c) * phi))
    pairup.add_init("2U", relpy.Const(1))
    return pairup