Class: Longjing::FF::ConnectivityGraph

Inherits:
Object
  • Object
show all
Defined in:
lib/longjing/ff/connectivity_graph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(problem) ⇒ ConnectivityGraph

Returns a new instance of ConnectivityGraph.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/longjing/ff/connectivity_graph.rb', line 8

def initialize(problem)
  @actions = problem.all_actions.map do |action|
    Action.new(action)
  end
  @add2actions = {}
  @pre2actions = {}
  @del2actions = {}
  @actions.each do |action|
    action.pre.each do |lit|
      @pre2actions[lit] ||= []
      @pre2actions[lit] << action
    end
    action.add.each do |lit|
      @add2actions[lit] ||= []
      @add2actions[lit] << action
    end
    action.del.each do |lit|
      @del2actions[lit] ||= {}
      @del2actions[lit][action] = true
    end
  end
  @literals = (@pre2actions.keys +
               @add2actions.keys +
               @del2actions.keys).uniq
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



6
7
8
# File 'lib/longjing/ff/connectivity_graph.rb', line 6

def actions
  @actions
end

#add2actionsObject (readonly)

Returns the value of attribute add2actions.



6
7
8
# File 'lib/longjing/ff/connectivity_graph.rb', line 6

def add2actions
  @add2actions
end

#del2actionsObject (readonly)

Returns the value of attribute del2actions.



6
7
8
# File 'lib/longjing/ff/connectivity_graph.rb', line 6

def del2actions
  @del2actions
end

#literalsObject (readonly)

Returns the value of attribute literals.



6
7
8
# File 'lib/longjing/ff/connectivity_graph.rb', line 6

def literals
  @literals
end

#pre2actionsObject (readonly)

Returns the value of attribute pre2actions.



6
7
8
# File 'lib/longjing/ff/connectivity_graph.rb', line 6

def pre2actions
  @pre2actions
end