public boolean setWeights(double[] weights)
    {
        if (weights == null) {
            return false;
        }

        // check whether the value of weights are correct
        for (int i = 0; i < weights.length; i++)
        {
            if (weights[i] <= 0)
            {
                System.out.println(name_ +
                    ".setWeights(): Error - weight must be a positive number.");
                return false;
            }
        }

        this.weights = weights;
        return true;
    }