Uploaded image for project: 'Commons Sandbox'
  1. Commons Sandbox
  2. SANDBOX-364

Adding generic weight type to model

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Graph

      Description

      Hello,

      with this patch I introduce generic weight types in all the implementations of the domain (mainly classes in the model packages both in main and test). Consequently I updated tests and references to be fully generic.

      One side effect is that WeightedEdge does not implement Comparable anymore, because that would imply passing it a Comparator for weights as an argument upon creation. Instead, without polluting WeightedEdge, I changed the classes where it was needed to be Comparable (e.g. in Kruskal there is a PriorityQueue that is now initialized with an appropriate Comparator instead of relying on Comparable edges).

      All tests are green. Hoping to help
      Claudio

        Attachments

        1. AddingGenericWeightTypeToModel.patch
          44 kB
          Claudio Squarcella

          Activity

            People

            • Assignee:
              simone.tripodi Simone Tripodi
              Reporter:
              claudio.squarcella Claudio Squarcella
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: