def __init__(self, name=None, state_id=None, input_data_ports=None, output_data_ports=None, income=None, outcomes=None, states=None, transitions=None, data_flows=None, start_state_id=None, scoped_variables=None, decider_state=None, load_from_storage=False):
    self.__init_running = True
    states = ({} if (states is None) else states)
    if (decider_state is not None):
        if isinstance(decider_state, DeciderState):
            decider_state._state_id = UNIQUE_DECIDER_STATE_ID
            states[UNIQUE_DECIDER_STATE_ID] = decider_state
        else:
            logger.warning('Argument decider_state has to be instance of DeciderState not {}'.format(decider_state))
    if ((not load_from_storage) and (UNIQUE_DECIDER_STATE_ID not in states)):
        states[UNIQUE_DECIDER_STATE_ID] = DeciderState(name='Decider', state_id=UNIQUE_DECIDER_STATE_ID)
    ConcurrencyState.__init__(self, name, state_id, input_data_ports, output_data_ports, income, outcomes, states, transitions, data_flows, start_state_id, scoped_variables)
    for (state_id, state) in self.states.items():
        if (state_id != UNIQUE_DECIDER_STATE_ID):
            for outcome in self.states[state_id].outcomes.values():
                match = [((t.from_state == state_id) and (t.from_outcome == outcome.outcome_id)) for t in self.transitions.values()]
                if ((not (outcome.outcome_id < 0)) and (not any(match))):
                    try:
                        self.add_transition(from_state_id=state_id, from_outcome=outcome.outcome_id, to_state_id=UNIQUE_DECIDER_STATE_ID, to_outcome=None)
                    except (ValueError, RecoveryModeException) as e:
                        if ('transition origin already connected to another transition' not in str(e)):
                            logger.error('default decider state transition could not be added: {}'.format(e))
                            raise
    self.__init_running = False
def __init__(self, name=None, state_id=None, input_data_ports=None, output_data_ports=None, income=None, outcomes=None, states=None, transitions=None, data_flows=None, start_state_id=None, scoped_variables=None, decider_state=None, load_from_storage=False):
    self.__init_running = True
    states = ({} if (states is None) else states)
    if (decider_state is not None):
        if isinstance(decider_state, DeciderState):
            decider_state._state_id = UNIQUE_DECIDER_STATE_ID
            states[UNIQUE_DECIDER_STATE_ID] = decider_state
        else:
            logger.warning('Argument decider_state has to be instance of DeciderState not {}'.format(decider_state))
    if ((not load_from_storage) and (UNIQUE_DECIDER_STATE_ID not in states)):
        states[UNIQUE_DECIDER_STATE_ID] = DeciderState(name='Decider', state_id=UNIQUE_DECIDER_STATE_ID)
    ConcurrencyState.__init__(self, name, state_id, input_data_ports, output_data_ports, income, outcomes, states, transitions, data_flows, start_state_id, scoped_variables)
    for (state_id, state) in self.states.items():
        if (state_id != UNIQUE_DECIDER_STATE_ID):
            for outcome in self.states[state_id].outcomes.values():
                match = [((t.from_state == state_id) and (t.from_outcome == outcome.outcome_id)) for t in self.transitions.values()]
                if ((not (outcome.outcome_id < 0)) and (not any(match))):
                    try:
                        self.add_transition(from_state_id=state_id, from_outcome=outcome.outcome_id, to_state_id=UNIQUE_DECIDER_STATE_ID, to_outcome=None)
                    except (ValueError, RecoveryModeException) as e:
                        if ('transition origin already connected to another transition' not in str(e)):
                            logger.error('default decider state transition could not be added: {}'.format(e))
                            raise
    self.__init_running = False