Skip to content

Commit

Permalink
Allow to modify DistanceMatrix after the HopfieldNetworkTSP object is…
Browse files Browse the repository at this point in the history
… created

Modify the DistanceMatrix value in the Cities property of the
HopfieldNetworkTSP class through the setCities function.
  • Loading branch information
mathinking committed Apr 24, 2017
1 parent 7c9f5a6 commit 5143201
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chn/+network/@HopfieldNetworkTSP/setCities.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function setCities(net,property,value)
net.Cities.DistanceType = value;
end
case 'DistanceMatrix'
options = tsphopfieldnetOptions('DistanceMatrix',value);
options = tsphopfieldnetOptions('DistanceMatrix',value,'DistanceType','explicit');
assert(size(value,1) == net.TrainParam.N, 'tsphopfieldnet:invalid_value', ...
['''DistanceMatrix'' must have ', num2str(net.TrainParam.N), ' rows and columns']);
net.Cities.DistanceMatrix = options.Cities.DistanceMatrix;
Expand Down

0 comments on commit 5143201

Please sign in to comment.