示例#1
0
 def exitLossfn_command(self, ctx:slatParser.Lossfn_commandContext):
     id = ctx.ID().getText()
     if ctx.simple_loss_command():
         options = self._stack.pop()
         data = self._stack.pop()
         pyslat.lossfn(id, options, data)
     else:
         raise ValueError("Unhanlded type of lossfn")
示例#2
0
for f in FRAG_DATA:
    id = f[0]
    frag = f[1]
    cost = f[2]
    delay = f[3]

    pyslat.fragfn_user(
        "FRAG.{:>03}".format(id),
        {"mu": pyslat.LOGNORMAL_MU_TYPE.MEAN_X, "sd": pyslat.LOGNORMAL_SIGMA_TYPE.SD_LN_X},
        frag,
    )

    pyslat.lossfn(
        "COST_{:>03}".format(id),
        {"mu": pyslat.LOGNORMAL_MU_TYPE.MEAN_X, "sd": pyslat.LOGNORMAL_SIGMA_TYPE.SD_LN_X},
        cost,
    )

    pyslat.lossfn(
        "DELAY_{:>03}".format(id),
        {"mu": pyslat.LOGNORMAL_MU_TYPE.MEAN_X, "sd": pyslat.LOGNORMAL_SIGMA_TYPE.SD_LN_X},
        delay,
    )

COMPONENT_DATA = [
    [1, "EDP.02", "FRAG.002", "COST_002", "DELAY_002", 20],
    [2, "EDP.02", "FRAG.002", "COST_002", "DELAY_002", 18],
    [3, "EDP.04", "FRAG.002", "COST_002", "DELAY_002", 4],
    [4, "EDP.04", "FRAG.002", "COST_002", "DELAY_002", 18],
    [5, "EDP.06", "FRAG.002", "COST_002", "DELAY_002", 4],