From 9020f68f734052a0bbf4f7d7b389ac5c42001266 Mon Sep 17 00:00:00 2001
From: dmt <>
Date: Fri, 18 Oct 2019 23:02:07 +0200
Subject: [PATCH] Depending on user input, instantiate conceptual or procedural
 constructor.

---
 cml/controller/api.py | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/cml/controller/api.py b/cml/controller/api.py
index b0db2ce..e02d2fb 100644
--- a/cml/controller/api.py
+++ b/cml/controller/api.py
@@ -86,9 +86,20 @@ def get_data_source():
     return preprocessing_usecase.execute(preprocessing_req)
 
 
-def construction(*args):
-    ml_models = [ConstructionClusteringMLModel(raw_model) for raw_model in args]
+def construction(construct_type, *args, **kwargs):
     construction_settings = specific_settings_factory("construction")
+    construction_settings.construct_type = construct_type
+
+    if construct_type == "conceptual":
+        ml_models = [ConstructionClusteringMLModel(raw_model)
+                     for raw_model in args]
+
+    elif construct_type == "procedural":
+        ml_models = [Autoencoder]
+
+    else:
+        raise Exception("Operation not supported!")
+
     create_constructor_req = CreateConstructorRequest(construction_settings,
                                                       ml_models)
     create_construction_usecase = CreateConstructorUsecase()
-- 
GitLab