//-------------------------------------------------------------------------------- LogStream& LogStream::setSeverity(std::string ms, const bool permanent /*= false*/) { boost::algorithm::to_lower(ms); if (ms == "high" ) { return setSeverity(LS_HIGH , permanent); } else if(ms == "normal") { return setSeverity(LS_NORMAL, permanent); } // else if(ms == "low" ) { return setSeverity(LS_LOW , permanent); } else { return setSeverity(LS_LOW , permanent); } // yes, this default to low is intentional }
bool MovingPeak::readData(){ /*************************************** // m_F Evaluation Function // 1 constant_basis_func() // 2 five_peak_basis_func() // 3 peak_function1() // 4 peak_function_cone() // 5 peak_function_hilly() // 6 peak_function_twin() ************************************** in>>temp>>m_vlength; // distance by which the peaks are moved, severity lambda determines whether there is a direction of the movement, or whether they are totally random. For lambda = 1.0 each move has the same direction, while for lambda = 0.0, each move has a random direction //in>>temp>>lambda; //in>>temp>>m_useBasisFunction; if set to 1, a static landscape (basis_function) is included in the fitness evaluation }*/ m_F=4; m_lambda=0; m_useBasisFunction=0; m_vlength=1.0; m_calculateRightPeak = 1; /* saves computation time if not needed and set to 0 */ m_minHeight = 30.0; m_maxHeight = 70.0; m_standardHeight = 50.0; m_minWidth = 1.0 ; m_maxWidth = 12.0; m_standardWidth = 0.0; setSeverity(); return true; }
int Test_Resource(SaHpiSessionIdT session_id, SaHpiRptEntryT rpt_entry, callback2_t func) { int i; SaErrorT status; SaHpiResourceIdT resource_id; int retval = SAF_TEST_UNKNOWN; SaHpiSeverityT severity[] = { SAHPI_OK + 1, SAHPI_DEBUG - 1, SAHPI_DEBUG + 1, SAHPI_ALL_SEVERITIES - 1, SAHPI_ALL_SEVERITIES }; resource_id = rpt_entry.ResourceId; // test many invalid severities for (i = 0; i < 5; i++) { retval = setSeverity(session_id, resource_id, severity[i]); if (retval != SAF_TEST_PASS) { break; } } return retval; }
void MovingPeak::reset(){ setSeverity(); int i=0; for ( i=0; i< m_numPeaks; i++) for (int j=0;j<m_numDim; j++){ mpp_peak[i][j] = 100.0*Global::msp_global->mp_uniformPro->Next(); mpp_prevMovement[i][j] = Global::msp_global->mp_uniformPro->Next()-0.5; } if (m_standardHeight <= 0.0){ for ( i=0; i< m_numPeaks; i++) mp_height[i]=(m_maxHeight-m_minHeight)*Global::msp_global->mp_uniformPro->Next()+m_minHeight; }else{ for (i=0; i< m_numPeaks; i++) mp_height[i]= m_standardHeight; } if (m_standardWidth <= 0.0){ for (i=0; i< m_numPeaks; i++) mp_width[i]= (m_maxWidth-m_minWidth)*Global::msp_global->mp_uniformPro->Next()+m_minWidth; }else{ for (i=0; i< m_numPeaks; i++) mp_width[i]= m_standardWidth; } calculateGlobalOptima(); m_changeCounter=0; for ( i=0; i< m_numPeaks; i++) mp_found[i]=false; for (i=0;i<m_numPeaks; i++) copy(mpp_peak[i],mpp_peak[i]+m_numDim,mpp_prePeak[i]); copy(mp_height,mp_height+m_numPeaks,mp_preHeight); copy(mp_width,mp_width+m_numPeaks,mp_preWidth); //calculateAssociateRadius(); /*for (i=0; i< m_numPeaks; i++) { mp_heightOrder[i]=i; mp_found[i]=false; } vector<int> idx(m_numPeaks); gQuickSort(mp_height,m_numPeaks,idx); copy(idx.begin(),idx.end(),mp_heightOrder); gAmendSortedOrder<double*>(mp_height,mp_heightOrder,mp_amendedHeightOrder,m_numPeaks);*/ m_peakQaulity=0; m_peaksFound=0; }
/** Default constructor. */ LogTreeItem::LogTreeItem(tc::Severity type, const QString &message, const QDateTime ×tamp) : QTreeWidgetItem() { static quint32 seqnum = 0; /* Set this message's sequence number */ _seqnum = seqnum++; /* Set the item's log time */ setTimestamp(timestamp); /* Set the item's severity and appropriate color. */ setSeverity(type); /* Set the item's message text. */ setMessage(message); }
std::ostream& Log::operator << ( const Log::LogLevel& ll ) { setSeverity( ll._level ); return *this; }