【问题标题】:When i run this code for aco i got error Uniform can not be resolved to a type当我为 aco 运行此代码时,出现错误 Uniform 无法解析为类型
【发布时间】:2015-10-08 10:01:41
【问题描述】:

这里的代码..这显示了使用uniform时的错误,即uniform无法解析为一个类型。

private Uniform uniform;

    private final ExecutorService threadPool = Executors.newFixedThreadPool(poolSize);

    private final ExecutorCompletionService<WalkedWay> agentCompletionService = new ExecutorCompletionService<WalkedWay>(
                    threadPool);

    final double[][] matrix;
    final double[][] invertedMatrix;
    private final double[][] pheromones;
    private final Object[][] mutexes;

    public AntColonyOptimization() throws IOException {
            // read the matrix
            matrix = readMatrixFromFile();
            invertedMatrix = invertMatrix();
            pheromones = initializePheromones();
            mutexes = initializeMutexObjects();
            // (double min, double max, int seed)
            uniform = new Uniform(0, matrix.length - 1, (int) System.currentTimeMillis());
    }

【问题讨论】:

  • 类名是Uniform,第一行不是uniform
  • 我已经改变了它..但问题是一样的。
  • 你需要import包含uniform类的包。

标签: java uniform


【解决方案1】:

在声明部分添加这一行

private Uniform uniform ;

【讨论】:

  • Uniform 类在哪里?你需要导入这个类
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-01-26
  • 2021-12-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多