Skip to content

Commit

Permalink
fix(implementationbase): make all StraightLines strategies equal
Browse files Browse the repository at this point in the history
  • Loading branch information
DanySK committed Nov 11, 2024
1 parent 9f33091 commit 6d94973
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import it.unibo.alchemist.model.routes.PolygonalChain
* @param <T> Concentration type
* @param <P> position type
*/
open class StraightLine<T, P : Position<P>> : RoutingStrategy<T, P> {
class StraightLine<T, P : Position<P>> : RoutingStrategy<T, P> {
override fun computeRoute(currentPos: P, finalPos: P): Route<P> = PolygonalChain(currentPos, finalPos)

override fun toString(): String = "StraightLine"

override fun equals(other: Any?): Boolean = other is StraightLine<*, *>

override fun hashCode() = 1
}

0 comments on commit 6d94973

Please sign in to comment.