示例#1
0
 def exitCompgroup_command(self, ctx: slatParser.Compgroup_commandContext):
     print(" > exitCompgroup_command()")
     compgroup_id = ctx.group_id().getText()
     edp_id = ctx.edp_id().getText()
     frag_id = ctx.frag_id().getText()
     cost_id = ctx.cost_id().getText()
     delay_id = ctx.delay_id() and ctx.delay_id().getText()
     count = int(ctx.INTEGER().getText())
     pyslat.compgroup(compgroup_id, pyslat.edp.lookup(edp_id),
                      pyslat.fragfn.lookup(frag_id),
                      pyslat.lossfn.lookup(cost_id), delay_id
                      and pyslat.lossfn.lookup(delay_id), count)
示例#2
0
 def exitCompgroup_command(self, ctx:slatParser.Compgroup_commandContext):
     print(" > exitCompgroup_command()")
     compgroup_id = ctx.group_id().getText()
     edp_id =  ctx.edp_id().getText()
     frag_id =  ctx.frag_id().getText()
     cost_id =  ctx.cost_id().getText()
     delay_id = ctx.delay_id() and ctx.delay_id().getText()
     count = int(ctx.INTEGER().getText())
     pyslat.compgroup(compgroup_id,
                      pyslat.edp.lookup(edp_id),
                      pyslat.fragfn.lookup(frag_id),
                      pyslat.lossfn.lookup(cost_id),
                      delay_id and pyslat.lossfn.lookup(delay_id),
                      count)
示例#3
0
building.setRebuildCost(
    pyslat.MakeLogNormalDist(14E6, pyslat.LOGNORMAL_MU_TYPE.MEAN_X, 0.35,
                             pyslat.LOGNORMAL_SIGMA_TYPE.SD_LN_X))
building.setDemolitionCost(
    pyslat.MakeLogNormalDist(14E6, pyslat.LOGNORMAL_MU_TYPE.MEAN_X, 0.35,
                             pyslat.LOGNORMAL_SIGMA_TYPE.SD_LN_X))
for comp in COMPONENT_DATA:
    id = comp[0]
    edp = comp[1]
    frag = comp[2]
    cost = comp[3]
    delay = comp[4]
    count = comp[5]

    cg = pyslat.compgroup("COMPGROUP_{:>03}".format(id),
                          pyslat.edp.lookup(edp), pyslat.fragfn.lookup(frag),
                          pyslat.lossfn.lookup(cost),
                          pyslat.lossfn.lookup(delay), count)
    print(id, edp, frag, cost, count)
    if id in [1, 2, 86, 96]:
        at_values = costedpvalues1
    elif id in [21, 31, 41]:
        at_values = costedpvalues5
    elif id in [71, 85, 106]:
        at_values = costedpvalues4
    elif id in [86, 87]:
        at_values = costedpvalues2
    elif (id >= 51 and id < 87) or (id >= 107):
        at_values = costedpvalues3
    else:
        at_values = costedpvalues2
示例#4
0
)
building.setDemolitionCost(
    pyslat.MakeLogNormalDist(14e6, pyslat.LOGNORMAL_MU_TYPE.MEAN_X, 0.35, pyslat.LOGNORMAL_SIGMA_TYPE.SD_LN_X)
)
for comp in COMPONENT_DATA:
    id = comp[0]
    edp = comp[1]
    frag = comp[2]
    cost = comp[3]
    delay = comp[4]
    count = comp[5]

    cg = pyslat.compgroup(
        "COMPGROUP_{:>03}".format(id),
        pyslat.edp.lookup(edp),
        pyslat.fragfn.lookup(frag),
        pyslat.lossfn.lookup(cost),
        pyslat.lossfn.lookup(delay),
        count,
    )
    print(id, edp, frag, cost, count)
    if id in [1, 2, 86, 96]:
        at_values = costedpvalues1
    elif id in [21, 31, 41]:
        at_values = costedpvalues5
    elif id in [71, 85, 106]:
        at_values = costedpvalues4
    elif id in [86, 87]:
        at_values = costedpvalues2
    elif (id >= 51 and id < 87) or (id >= 107):
        at_values = costedpvalues3
    else: