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.



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

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.



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

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 webget_ramp gem.



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

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’.



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

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