1 class ChoiceInformation
{
4 protected double[][] ChoiceInformation
;
6 ChoiceInformation(Graph graph
) {
8 ChoiceInformation
= new double[graph
.getNumOfCities()][graph
.getNumOfCities()];
10 for (int i
= 0; i
< graph
.getNumOfCities(); i
++) {
11 for (int j
= 0; j
< graph
.getNumOfCities(); j
++) {
12 setChoiceInformation(i
,j
, 0);
17 public void computeChoiceInformation() {
18 for (int i
= 0; i
< graph
.getNumOfCities(); i
++) {
19 for (int j
= 0; j
< graph
.getNumOfCities(); j
++) {
20 setChoiceInformation(i
,j
,
21 Math
.pow( graph
.getPheromone(i
,j
), graph
.getALPHA() ) *
22 Math
.pow( (1.0/(double)graph
.getDistance(i
,j
)), graph
.getBETA() ));
27 public double[][] getChoiceInformation() {
28 return this.ChoiceInformation
;
31 public double getChoiceInformation(int x
, int y
) {
32 return this.ChoiceInformation
[x
][y
];
35 public void setChoiceInformation(double[][] ChoiceInformation
) {
36 this.ChoiceInformation
= ChoiceInformation
;
39 public void setChoiceInformation(int x
, int y
, double ChoiceInformation
) {
40 this.ChoiceInformation
[x
][y
] = ChoiceInformation
;