Ejemplo n.º 1
0
void ProductBuilder::addStateTransitions(const UnparametrizedStructure & structure, const AutomatonStructure & automaton, const StateID s_BA_ID, const StateID s_KS_ID, const AutTransitionion & BA_transition, ProductStructure & product)
{
	StateID s_ID = product.computeID(s_KS_ID, s_BA_ID);

	// Add all the transient combinations for the kripke structure
	for (const size_t KS_trans_no : cscope(structure._states[s_KS_ID]))
	{
		const StateID t_KS_ID = structure._states[s_KS_ID]._transitions[KS_trans_no]._t_ID;
		if (satisfiesDeltas(structure, s_KS_ID, t_KS_ID, BA_transition._deltas_cons)) 
		{
			const TransConst & trans_const = structure._states[s_KS_ID]._transitions[KS_trans_no]._trans_const;
			const StateID t_ID = product.computeID(t_KS_ID, BA_transition._t_ID);
			product._states[s_ID]._transitions.emplace_back(TSTransitionProperty(t_ID, trans_const));
		}
	}

	// Copy stay constraints
	product._states[s_ID]._stay_const = structure._states[s_KS_ID]._stay_const;

	// Add a self-loops
	product._states[s_ID]._loops.emplace_back(product.computeID(s_KS_ID, BA_transition._t_ID));
}
	/**
	 * @param ID	add data to the state with this IS
	 * Add a new transition to the source specie, containg necessary edge labels for the CMC
	 */
	inline void addTransition(const StateID ID, const StateID target_ID, const ParamNo step_size, const bool _dir, const ActLevel level, const Levels & targets) {
		GraphInterface<TSStateProperty>::states[ID].transitions.push_back(TSTransitionProperty(target_ID, step_size, _dir, level, targets));
	}