Sha256: df3224e399867b085c45e2b49fa101ae26482b06170fe87deef2c2599b4d2889

Contents?: true

Size: 639 Bytes

Versions: 2

Compression:

Stored size: 639 Bytes

Contents

# Context conflict resolution policies
module Phenomenal::ConflictPolicies
  
  # Prefer not default adaptation, error if two not default ones
    def no_resolution_conflict_policy(context1,context2)
      if context1==default_context()
        1
      elsif context2==default_context()
        -1
      else #Fail if two non default adaptations
        Phenomenal::Logger.instance.error(
            "Illegal duplicate adapation between contexts #{context1} and #{context2} "
        )
      end
    end

    # Age based conflict resolution
    def age_conflict_policy(context1, context2)
       context1.age <=> context2.age
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phenomenal-1.1.0 lib/phenomenal/conflict_policies.rb
phenomenal-1.0.1 lib/phenomenal/conflict_policies.rb