All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.micro.testcases.nfproperties.CoreNumberProperty2 Maven / Gradle / Ivy

Go to download

The Jadex micro applications package contains several example applications, benchmarks and testcases using micro agents.

There is a newer version: 4.0.267
Show newest version
package jadex.micro.testcases.nfproperties;

import jadex.bridge.nonfunctional.AbstractNFProperty;
import jadex.bridge.nonfunctional.NFPropertyMetaInfo;
import jadex.commons.future.Future;
import jadex.commons.future.IFuture;

/**
 *  Non-functional property reporting the CPU core count with a different name.
 *
 */
public class CoreNumberProperty2 extends AbstractNFProperty
{
	/** CPU core count. */
	protected int cores;
	
	/**
	 *  Create the property.
	 */
	public CoreNumberProperty2()
	{
		super(new NFPropertyMetaInfo("componentcores", int.class, null, false, -1, false, null));
		cores = Runtime.getRuntime().availableProcessors();
		
//		Properties props = System.getProperties();
//		for (Object key : props.keySet())
//		{
//			System.out.println(System.getProperty((String) key));
//		}
	}

//	public IFuture getValue(Class unit)
	/**
	 *  Gets the value.
	 */
	public IFuture getValue(Void unit)
	{
		return new Future(cores);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy