remove testing code, no need to now pass memory as parameter, see prev commit

Umar M. Sheikh 11 years ago
parent
commit
e7e3b852c5
1 changed files with 1 additions and 13 deletions
  1. 1 13
      app/models/agents/code_agent.rb

+ 1 - 13
app/models/agents/code_agent.rb

@@ -67,19 +67,7 @@ module Agents
67 67
       end
68 68
       true
69 69
     end
70
-    def setter_and_getter_memory(incoming_events = "")
71
-      context = V8::Context.new
72
-      context.eval(example_js)
73
-      context["create_event"] = lambda {|x,y| puts x; puts y; create_event payload: JSON.parse(y)}
74
-      context["access_memory"] = lambda {|a, x, y| x && y ? (memory[x] = y; memory.to_json) : memory.to_json }
75 70
 
76
-      context.eval(options['code']) # should override the run function.
77
-      a, e, o = [self.attributes.to_json, incoming_events.to_json, self.options.to_json]
78
-      string = "a = new Agent('#{e}','#{o}','#{a}');"
79
-      context.eval(string)
80
-      binding.pry
81
-      context.eval("a.memory()")
82
-    end
83 71
     def execute_js(incoming_events)
84 72
       context = V8::Context.new
85 73
       context.eval(example_js)
@@ -90,9 +78,9 @@ module Agents
90 78
       a, e, o = [self.attributes.to_json, incoming_events.to_json, self.options.to_json]
91 79
       string = "a = new Agent('#{e}','#{o}','#{a}');"
92 80
       context.eval(string)
93
-      context.eval("a.memory('5','6')") # set memory for testing
94 81
       context.eval("a.run();")
95 82
     end
83
+
96 84
     def check
97 85
       execute_js("")
98 86
     end