예제 #1
0
파일: State.py 프로젝트: yirenshen666/SUAVE
class Container(State):
    def __defaults__(self):
        """ This sets the default values.
    
            Assumptions:
            Puts the segments in the right order
    
            Source:
            N/A
    
            Inputs:
            None
    
            Outputs:
            None
    
            Properties Used:
            None
        """
        self.segments = DataOrdered()

    def merged(self):
        """ Combines the states of multiple segments
    
            Assumptions:
            None
    
            Source:
            N/A
    
            Inputs:
            None
    
            Outputs:
            state_out [State()]
    
            Properties Used:
            None
        """

        state_out = State()

        for i, (tag, sub_state) in enumerate(self.segments.items()):
            for key in ['unknowns', 'conditions', 'residuals']:
                if i == 0:
                    state_out[key].update(sub_state[key])
                else:
                    state_out[key] = state_out[key].do_recursive(
                        append_array, sub_state[key])

        return state_out
예제 #2
0
파일: State.py 프로젝트: michK/SUAVE
class Container(State):
    def __defaults__(self):
        """ This sets the default values.
    
            Assumptions:
            Puts the segments in the right order
    
            Source:
            N/A
    
            Inputs:
            None
    
            Outputs:
            None
    
            Properties Used:
            None
        """         
        self.segments = DataOrdered()
        
    def merged(self):
        """ Combines the states of multiple segments
    
            Assumptions:
            None
    
            Source:
            N/A
    
            Inputs:
            None
    
            Outputs:
            state_out [State()]
    
            Properties Used:
            None
        """              
        
        state_out = State()
        
        for i,(tag,sub_state) in enumerate(self.segments.items()):
            for key in ['unknowns','conditions','residuals']:
                if i == 0:
                    state_out[key].update(sub_state[key])
                else:
                    state_out[key] = state_out[key].do_recursive(append_array,sub_state[key])
            
        return state_out
예제 #3
0
class Container(State):
    def __defaults__(self):
        self.segments = DataOrdered()

    def merged(self):

        state_out = State()

        for i, (tag, sub_state) in enumerate(self.segments.items()):
            for key in ['unknowns', 'conditions', 'residuals']:
                if i == 0:
                    state_out[key].update(sub_state[key])
                else:
                    state_out[key] = state_out[key].do_recursive(
                        append_array, sub_state[key])

        return state_out