How to use the gekko.gk_operators.GK_Operators.__init__ function in gekko

To help you get started, we’ve selected a few gekko examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BYU-PRISM / GEKKO / gekko / gk_operators.py View on Github external
def __init__(self, name, value=None):
        GK_Operators.__init__(self,name, value=None)
github BYU-PRISM / GEKKO / gekko / gk_variable.py View on Github external
def __init__(self, name='', value=None, lb=None, ub=None, integer=False):
        if name == '':
            name = 'v' + GKVariable.counter
            GKVariable.counter += 1
            if integer == True:
                name = 'int_'+name
        
        
        # prevents the __setattr__ function from sending options to the server
        # until the __init__ function has completed since they should only be
        # sent if changed from their defaults
        self.__dict__['_initialized'] = False

        GK_Operators.__init__(self, name, value=value)

        #self.VALUE = value #initialized value is done in GK_Operators
        if not hasattr(self,'type'): #don't overwrite SV and CV
            self.type = None 
            
        if lb is not None:
            self.LOWER = lb
        else:
            self.LOWER = None
        if ub is not None:
            self.UPPER = ub
        else:
            self.UPPER = None
        
        #register fixed values through connections to ensure consistency in the 
        #csv file, otherwise the requested fixed value will be overridden by
github BYU-PRISM / GEKKO / gekko / gk_parameter.py View on Github external
def __init__(self, name='', value=None, integer=False):
        if name == '':
            name = 'p' + GKParameter.counter
            GKParameter.counter += 1
            if integer == True:
                name = 'int_' + name
                
        # prevents the __setattr__ function from sending options to the server
        # until the __init__ function has completed since they should only be
        # sent if changed from their defaults
        self.__dict__['_initialized'] = False
        
        GK_Operators.__init__(self, name, value=value)

        #self.VALUE = value #initialized value SET IN GK_Operators
            
        if not hasattr(self,'type'): #don't overwrite FV and MV
            self.type = None 
        
        # now allow options to be sent to the server
        self._initialized = True