
jadex.bdi.benchmarks.ReteBuilderPerformanceTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-bdi Show documentation
Show all versions of jadex-applications-bdi Show documentation
The Jadex BDI applications package contain
several example applications, benchmarks and
testcases using BDI agents.
The newest version!
package jadex.bdi.benchmarks;
import jadex.bdi.runtime.interpreter.BDIInterpreter;
import jadex.rules.rulesystem.rete.RetePatternMatcherFunctionality;
import jadex.rules.rulesystem.rete.builder.BuildReport;
import jadex.rules.rulesystem.rete.builder.ReteBuilder;
import java.util.List;
/**
* Test the performance of the rete builder.
*/
public class ReteBuilderPerformanceTest
{
/**
* Main for testing.
*/
public static void main(String[] args)
{
BuildReport report = new BuildReport();
for(int i=0; i<1000; i++)
{
RetePatternMatcherFunctionality pm = new RetePatternMatcherFunctionality(BDIInterpreter.RULEBASE);
ReteBuilder builder = pm.getReteNode().getBuilder();
if(builder!=null && builder.getBuildReport()!=null)
{
List newinfos = builder.getBuildReport().getBuildInfos();
report.getBuildInfos().addAll(newinfos);
}
}
System.out.println(report);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy