From 6c35e3f8369ba96cb251eac487424bd949fdcf6c Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Tue, 2 Jul 2013 19:23:01 +0200 Subject: Algorithms and Models are modules instead of classes. --- lib/model.rb | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'lib/model.rb') diff --git a/lib/model.rb b/lib/model.rb index e49eff3..1dbac6d 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -1,7 +1,7 @@ module OpenTox - class Model - + module Model +=begin # Run a model with parameters # @param params [Hash] Parameters for OpenTox model # @param wait [optional,OpenTox::Task] waiting_task (can be a OpenTox::Subtask as well), progress is updated accordingly @@ -10,6 +10,7 @@ module OpenTox uri = RestClientWrapper.post @uri, params, { :content_type => "text/uri-list", :subjectid => @subjectid} wait_for_task uri if wait end +=end def feature_type # CH: subjectid is a object variable, no need to pass it as a parameter unless @feature_type @@ -41,5 +42,23 @@ module OpenTox end end + class Generic + include OpenTox + include OpenTox::Algorithm + end + + class Lazar + include OpenTox + include OpenTox::Algorithm + def self.create params + Lazar.new(File.join($algorithm[:uri], "lazar")).run params + end + + def predict params + run params + end + + end + end end -- cgit v1.2.3