• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java InvalidRepresentationException类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.apache.commons.math3.genetics.InvalidRepresentationException的典型用法代码示例。如果您正苦于以下问题:Java InvalidRepresentationException类的具体用法?Java InvalidRepresentationException怎么用?Java InvalidRepresentationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

InvalidRepresentationException类属于org.apache.commons.math3.genetics包,在下文中一共展示了InvalidRepresentationException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkValidity

点赞 2

import org.apache.commons.math3.genetics.InvalidRepresentationException; //导入依赖的package包/类
/**
 * Solution validity check.
 * 
 * @param solution
 *            List of tasks.
 * 
 * @throws InvalidRepresentationException
 *             Invalid solution exception.
 */
@Override
protected void checkValidity(List<Task> solution) throws InvalidRepresentationException {
	/*
	 * List of tasks should not be empty.
	 */
	if (solution.size() == 0) {
		throw new InvalidRepresentationException(LocalizedFormats.DIMENSION, solution.size());
	}
}
 

开发者ID:TodorBalabanov,
项目名称:Genetic-Algorithm-for-Machinery-Usage-Scheduling,
代码行数:19,
代码来源:TaskListChromosome.java

示例2: checkValidity

点赞 2

import org.apache.commons.math3.genetics.InvalidRepresentationException; //导入依赖的package包/类
@Override
protected void checkValidity(List<Integer> chromosomeRepresentation) throws InvalidRepresentationException {
	if(chromosomeRepresentation.size()!=18) throw new InvalidRepresentationException(new Localizable() {
		
		@Override
		public String getSourceString() {
			return "The chromosome must have exactly 18 gens. It currently have "+chromosomeRepresentation.size();
		}
		
		@Override
		public String getLocalizedString(Locale locale) {
			return this.getSourceString();
		}
	});
}
 

开发者ID:gDanix,
项目名称:Genetic-Ingress-Attack-Optimizer,
代码行数:16,
代码来源:XMPChromosome.java

示例3: checkValidity

点赞 2

import org.apache.commons.math3.genetics.InvalidRepresentationException; //导入依赖的package包/类
@Override
protected void checkValidity(List<Character> repr) throws InvalidRepresentationException {
    for (char c : repr) {
        if (c < 32 || c > 126) {
            throw new InvalidRepresentationException(LocalizedFormats.INVALID_FIXED_LENGTH_CHROMOSOME);
        }
    }
}
 

开发者ID:Quanticol,
项目名称:CARMA,
代码行数:9,
代码来源:HelloWorldExample.java

示例4: Objenome

点赞 2

import org.apache.commons.math3.genetics.InvalidRepresentationException; //导入依赖的package包/类
public Objenome(Multitainer context, Collection<Solution> parameters) throws InvalidRepresentationException {
    super();
            
    for (Solution o : parameters)
        genes.put(o.key(), o);
    
    this.parentContext = context;
}
 

开发者ID:automenta,
项目名称:objenome_prototype,
代码行数:9,
代码来源:Objenome.java

示例5: checkValidity

点赞 2

import org.apache.commons.math3.genetics.InvalidRepresentationException; //导入依赖的package包/类
@Override
protected void checkValidity(List<Polygon> chromosomeRepresentation) throws InvalidRepresentationException {
    // do nothing
}
 

开发者ID:Quanticol,
项目名称:CARMA,
代码行数:5,
代码来源:PolygonChromosome.java

示例6: TaskListChromosome

点赞 1

import org.apache.commons.math3.genetics.InvalidRepresentationException; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param representation
 *            Solution vector.
 * @param work
 *            Work unit reference.
 * 
 * @throws InvalidRepresentationException
 *             Invalid solution exception.
 */
public TaskListChromosome(Task[] representation, WorkUnit work) throws InvalidRepresentationException {
	super(representation);
	this.work = work;
}
 

开发者ID:TodorBalabanov,
项目名称:Genetic-Algorithm-for-Machinery-Usage-Scheduling,
代码行数:16,
代码来源:TaskListChromosome.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)