smlRunState Agent::GetRunState()
{
	AnalyzeXML response ;

	bool ok = GetConnection()->SendAgentCommand(&response, sml_Names::kCommand_GetRunState, GetAgentName(), sml_Names::kParamValue, sml_Names::kParamRunState) ;

	if (!ok)
		return smlRunState(0) ;

	return smlRunState(response.GetResultInt(0)) ;
}
int Agent::GetDecisionCycleCounter()
{
	AnalyzeXML response ;

	bool ok = GetConnection()->SendAgentCommand(&response, sml_Names::kCommand_GetRunState, GetAgentName(), sml_Names::kParamValue, sml_Names::kParamDecision) ;

	if (!ok)
		return 0 ;

	return response.GetResultInt(0) ;
}
smlPhase Agent::GetCurrentPhase()
{
	AnalyzeXML response ;

	bool ok = GetConnection()->SendAgentCommand(&response, sml_Names::kCommand_GetRunState, GetAgentName(), sml_Names::kParamValue, sml_Names::kParamPhase) ;

	if (!ok)
		return sml_INPUT_PHASE ;

	smlPhase phase = smlPhase(response.GetResultInt(int(sml_INPUT_PHASE))) ;

	return phase ;
}
smlRunResult Agent::GetResultOfLastRun()
{
	AnalyzeXML response ;

	bool ok = GetConnection()->SendAgentCommand(&response, sml_Names::kCommand_GetResultOfLastRun, GetAgentName()) ;

	if (!ok)
		return sml_RUN_ERROR ;

	smlRunResult result = smlRunResult(response.GetResultInt(int(sml_RUN_ERROR))) ;

	return result ;
}