From 3ae5edcc4994ce846fce45b343642666759be3d4 Mon Sep 17 00:00:00 2001 From: s460941 Date: Tue, 9 Jun 2020 17:11:27 +0200 Subject: [PATCH] fixed baseline --- .idea/workspace.xml | 45 ++++++++++++++++++++++++++++++--------------- main.py | 17 ++++++++++++++--- worker.fcl | 2 +- 3 files changed, 45 insertions(+), 19 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 027a059..9485c12 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,12 +2,10 @@ - - + + + + - - - @@ -91,13 +83,36 @@ + + + + + + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/main.py - 39 + 45 diff --git a/main.py b/main.py index bc1682f..a389a63 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,14 @@ -import os from fcl_parser import FCLParser import skfuzzy.control as ctrl import pandas as pd + +def myround(x): + r = 0 + if (x < 0): r = x // 1 + if (x > 0): r = int(round(x)) + return r + teams = pd.read_csv('teams_list.csv') matches = pd.read_csv('matches_list.csv') @@ -43,9 +49,14 @@ for i in range(0,224): #module.input['points'] = matches_input[i][2] module.compute() x = module.output['result'] - y = int(x + (x % (1 if x >= 0 else -1))) + x = float("{:.4f}".format(x)) + + #y = int(x + (x % (1 if x >= 0 else -1))) + #y = myround(x) + y = int(round(x)) predictions.append(y) - print(str(y) +": " + str(matches_input[i][3])) + #print(str(y) +": " + str(matches_input[i][3])) + print("FCL: " +str(x) + " ROUND: " + str(y) + " GROUND: " + str(matches_input[i][3])) num = 0 cor = 0 diff --git a/worker.fcl b/worker.fcl index e4998db..419a7be 100644 --- a/worker.fcl +++ b/worker.fcl @@ -34,7 +34,7 @@ END_FUZZIFY DEFUZZIFY result RANGE := (-1.000 .. 1.000); TERM home := (-1,1) (0,0); - TERM draw := (-0.5,0) (0,1) (0.5,1); + TERM draw := (-0.5,0) (0,1) (0.5,0); TERM away := (0,0) (1,1); METHOD : COG; // ACCU : MAX;