Module: Netica

Defined in:
lib/webget_netica/netica.rb

Instance Method Summary collapse

Instance Method Details

#environ(options = nil) ⇒ Object

Initialize the Netica environment with default settings.



17
18
19
# File 'lib/webget_netica/netica.rb', line 17

def environ(options=nil)
 return Java::NorsysNetica::Environ.new(options)
end

#finalizer(x) ⇒ Object

Free an object then finalize it. This is typically for JRuby objects.



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/webget_netica/netica.rb', line 45

def finalizer(x)
 return if !defined?(x) or x==nil
 begin
  x.respond_to?('free') and x.free()
 rescue
 end
 begin
  x.respond_to?('finalize') and x.finalize()
 rescue
 end
end

#load_cases(filepath) ⇒ Object

Read rows of a typical file of cases. The cases are tab delimited format. The IO.readrows method is in the ramp gem.



37
38
39
# File 'lib/webget_netica/netica.rb', line 37

def load_cases(filepath)
 return IO.readrows(filepath)
end

#load_net(filepath) ⇒ Object

Read a net file and compile it. The net file extensions is typically ‘.dne’ or ‘.neta’.



25
26
27
28
29
30
# File 'lib/webget_netica/netica.rb', line 25

def load_net(filepath)
 streamer = Java::NorsysNetica::Streamer.new(filepath)
 net = Java::NorsysNetica::Net.new(streamer)
 net.compile()
 return net
end