1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/icfp-solver/src/main/java/ru/bosony/graph/CellsLink.java Mon Jul 16 13:10:14 2012 +0400
1.3 @@ -0,0 +1,59 @@
1.4 +package ru.bosony.graph;
1.5 +
1.6 +import ru.bosony.model.mine.Cell;
1.7 +import ru.bosony.model.mine.Mine;
1.8 +
1.9 +/**
1.10 + * @author indvdum (gotoindvdum[at]gmail[dot]com) <br>
1.11 + * 16.07.2012 11:09:35
1.12 + *
1.13 + */
1.14 +public class CellsLink {
1.15 + Mine mine;
1.16 + Cell source;
1.17 + Cell target;
1.18 + double weight = 1d;
1.19 +
1.20 + public CellsLink(Mine mine, Cell source, Cell target) {
1.21 + this.mine = mine;
1.22 + this.source = source;
1.23 + this.target = target;
1.24 + calculateWeight();
1.25 + }
1.26 +
1.27 + protected void calculateWeight() {
1.28 +
1.29 + }
1.30 +
1.31 + public Mine getMine() {
1.32 + return mine;
1.33 + }
1.34 +
1.35 + public Cell getSource() {
1.36 + return source;
1.37 + }
1.38 +
1.39 + public Cell getTarget() {
1.40 + return target;
1.41 + }
1.42 +
1.43 + public double getWeight() {
1.44 + return weight;
1.45 + }
1.46 +
1.47 + @Override
1.48 + public int hashCode() {
1.49 + // TODO Auto-generated method stub
1.50 + return super.hashCode();
1.51 + }
1.52 +
1.53 + @Override
1.54 + public boolean equals(Object obj) {
1.55 + if (obj instanceof CellsLink) {
1.56 + CellsLink otherLink = (CellsLink) obj;
1.57 + return source.equals(otherLink.source) && target.equals(otherLink.target);
1.58 + }
1.59 + return super.equals(obj);
1.60 + }
1.61 +
1.62 +}