Ejemplo n.º 1
0
    def exitFragfn_command(self, ctx:slatParser.Fragfn_commandContext):
        id = ctx.ID().getText()
        db_params = ctx.fragfn_db_params()
        if db_params:
            db_params = self._stack.pop()
            pyslat.fragfn_db(id, db_params)
        else:
            params = ctx.fragfn_user_defined_params()
            options = self._stack.pop()
            scalars = self._stack.pop()

            pyslat.fragfn_user(id, options, scalars)
Ejemplo n.º 2
0
    def exitFragfn_command(self, ctx: slatParser.Fragfn_commandContext):
        id = ctx.ID().getText()
        db_params = ctx.fragfn_db_params()
        if db_params:
            db_params = self._stack.pop()
            pyslat.fragfn_db(id, db_params)
        else:
            params = ctx.fragfn_user_defined_params()
            options = self._stack.pop()
            scalars = self._stack.pop()

            pyslat.fragfn_user(id, options, scalars)
Ejemplo n.º 3
0
                        [[0.25, 0.6], [0.50, 0.6], [1.00, 0.6], [2.00, 0.6]],
                        [[200.0, 0.63], [1200.0, 0.63], [3600.0, 0.63],
                         [10000.0, 0.63]],
                        [[None, None], [None, None], [None, None],
                         [None, None]]
                    ]]

for f in SIMPLE_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.MEDIAN_X,
            'sd': pyslat.LOGNORMAL_SIGMA_TYPE.SD_LN_X
        }, frag)

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

    pyslat.simplelossfn(
        "DELAY_{:>03}".format(id), {
            'mu': pyslat.LOGNORMAL_MU_TYPE.MEAN_X,
            'sd': pyslat.LOGNORMAL_SIGMA_TYPE.SD_LN_X
        }, delay)
Ejemplo n.º 4
0
        214,
        [[0.25, 0.6], [0.50, 0.6], [1.00, 0.6], [2.00, 0.6]],
        [[200.0, 0.63], [1200.0, 0.63], [3600.0, 0.63], [10000.0, 0.63]],
        [[None, None], [None, None], [None, None], [None, None]],
    ],
]

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,
    )