Ejemplo n.º 1
0
void MindAreaInfo::createFromXml( Xml xml )
{
	// attributes are properties
	areaId = xml.getAttribute( "id" );

	int x , y , z;
	x = xml.getIntProperty( "posX" );
	y = xml.getIntProperty( "posY" );
	z = xml.getIntProperty( "posZ" );
	location.setPosition( x , y , z );

	int dx , dy , dz;
	dx = xml.getIntProperty( "sizeX" );
	dy = xml.getIntProperty( "sizeY" );
	dz = xml.getIntProperty( "sizeZ" );
	location.setDimensions( dx , dy , dz );

	size = location.getSize();

	// child elements are MindLink
	for( Xml xmlChild = xml.getFirstChild( "MindLink" ); xmlChild.exists(); xmlChild = xmlChild.getNextChild( "MindLink" ) ) {
		// construct MindArea from attributes
		MindLinkInfo *info = new MindLinkInfo;
		info -> createFromXml( xmlChild );

		// add
		links.add( info );
	}
}
Ejemplo n.º 2
0
void ThreadPool::configure( Xml config ) {
	runEnabled = config.getBooleanProperty( "run" , true );
	nThreads = config.getIntProperty( "threadCount" , 10 );
	secondsPerMonitoringCycle = config.getIntProperty( "secondsPerMonitoringCycle" , 10 );
	maxLoadPercents = config.getIntProperty( "maxLoadPercents" , 10 );
	stopSignal = false;
}
Ejemplo n.º 3
0
void HtmHelper::showLayer( String title , HtmLayer *layer )
{
	Xml xml = logger.getLogSettings();
	int layerPos = xml.getIntProperty( "showLayer" , -1 );
	if( layerPos >= 0 && layer -> getLayerPos() != layerPos )
		return;

	logger.logDebug( title + " - sequences are:" );
	HtmLayerMemory *lm = layer -> getMemory();

	int n = lm -> getSequenceCount();
	for( int k = 0; k < n; k++ )
		{
			HtmSequence *seq = lm -> getSequenceByPos( k );
			showSequence( String( "s[" ) + k + "]" , seq );
		}
}
Ejemplo n.º 4
0
void HtmHelper::showAcceptWithoutPrediction( int layerPos , int h , int v , HtmSequence *cs , HtmSequence *csa , int action )
{
	Xml xml = logger.getLogSettings();
	String s = xml.getProperty( "showAcceptActions" , "" );
	char l_buf[ 10 ];
	sprintf( l_buf , "%d" , action );
	if( strstr( s , l_buf ) == NULL )
		return;

	int layer = xml.getIntProperty( "showLayer" , -1 );
	if( layer >= 0 && layer != layerPos )
		return;

	String area = String( "l" ) + layerPos + "-h" + h + "-v" + v;
	logger.logDebug( area + ": action=" + action );
	showSequence( "current" , cs );
	showSequence( "stored" , csa );
}