3 class ChoiceInformation
{
6 protected double[][] ChoiceInformation
;
8 ChoiceInformation(Graph graph
) {
10 ChoiceInformation
= new double[graph
.getNumOfCities()][graph
.getNumOfCities()];
12 for (int i
= 0; i
< graph
.getNumOfCities(); i
++) {
13 for (int j
= 0; j
< graph
.getNumOfCities(); j
++) {
14 setChoiceInformation(i
,j
, 0);
19 public void computeChoiceInformation() {
20 for (int i
= 0; i
< graph
.getNumOfCities(); i
++) {
21 for (int j
= 0; j
< graph
.getNumOfCities(); j
++) {
22 setChoiceInformation(i
,j
,
23 Math
.pow( graph
.getPheromone(i
,j
), graph
.getALPHA() ) *
24 Math
.pow( (1.0/(double)graph
.getDistance(i
,j
)), graph
.getBETA() ));
29 public double[][] getChoiceInformation() {
30 return this.ChoiceInformation
;
33 public double getChoiceInformation(int x
, int y
) {
34 return this.ChoiceInformation
[x
][y
];
37 public void setChoiceInformation(double[][] ChoiceInformation
) {
38 this.ChoiceInformation
= ChoiceInformation
;
41 public void setChoiceInformation(int x
, int y
, double ChoiceInformation
) {
42 this.ChoiceInformation
[x
][y
] = ChoiceInformation
;