Skip to content

Piecewise utility function feature#1

Open
mgutierrezc wants to merge 2 commits intomasterfrom
piece_feat
Open

Piecewise utility function feature#1
mgutierrezc wants to merge 2 commits intomasterfrom
piece_feat

Conversation

@mgutierrezc
Copy link
Member

This feature allows users to input piecewise utility functions in the round_configs/demo.yaml file.

  • Documentation for yaml

    # if the parameter 'piecewise_utility' is True, the syntax should be a string like this one
    #"(piece 1, domain for piece 1);(piece 2, domain for piece 2)...". e.g: “(11 + 12*(x+(11.2*y - 0.5*(y**2))), y<11.2);(11 + 12*(x + 0.5*(11.2**2)), y>=11.2)”
    # else, the syntax is a string with the "function". e.g: "(x ** 0.5) * (y ** 0.5)"
    piecewise_utility: true
    utility_function: “(11 + 12*(x+(11.2*y - 0.5*(y**2))), y<11.2);(11 + 12*(x + 0.5*(11.2**2)), y>=11.2)”

  • Documentation for models

    def utility_function(self, x, y):
    """
    Evaluates the inputted parameters on a continuous/piecewise function
    Input: parameter values for x and y (float)
    Output: value of function after evaluating the values (float)
    """

@mgutierrezc mgutierrezc added the enhancement New feature or request label Mar 21, 2022
@mgutierrezc mgutierrezc requested a review from bwillia437 March 21, 2022 10:21
@mgutierrezc mgutierrezc self-assigned this Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments