Sha256: 6a2149bbbcbd08caef83d9089a93d88faf46f53f5eaab254fc8e78ceaf667f35

Contents?: true

Size: 681 Bytes

Versions: 4

Compression:

Stored size: 681 Bytes

Contents

# Context conflict resolution policies
module Phenomenal::ConflictPolicies
  # Prefer not default adaptation, error if two not default ones
    def no_resolution_conflict_policy(adaptation1,adaptation2)
      if adaptation1.context==default_context()
        1
      elsif adaptation2.context.name==default_context()
        -1
      else #Fail if two non default adaptations
        Phenomenal::Logger.instance.error(
            "Error: Illegal duplicate adapation of #{adaptation1.to_s}"
        )
      end
    end

    # Age based conflict resolution
    def age_conflict_policy(adaptation1, adaptation2)
       adaptation1.context.age <=> adaptation2.context.age
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
phenomenal-0.99.0 lib/phenomenal/conflict_policies.rb
phenomenal-0.9.0 lib/phenomenal/conflict_policies.rb
phenomenal-0.11.11.24.4 lib/phenomenal/conflict_policies.rb
phenomenal-0.11.11.24.3 lib/phenomenal/conflict_policies.rb