Skip to content

Commit

Permalink
Consertos finais e makefile
Browse files Browse the repository at this point in the history
Geração do compilado, conserto de problemas nos indices aleatórios e de buffering output.
  • Loading branch information
LBBassani committed Nov 14, 2020
1 parent 09b4ce3 commit d925d78
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ cabal.project.local~
.HTF/
.ghc.environment.*

testes
testes
main
2 changes: 1 addition & 1 deletion DataHandler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ base_treino_teste regs percent seed = (base_treino, base_teste)
where
base_treino = [ regs!!x | x <- drop n aleatorios]
base_teste = [ regs!!x | x <- take n aleatorios]
aleatorios = randomList tamanho seed (tamanho)
aleatorios = randomList tamanho seed (tamanho - 1)
n = truncate $ fromIntegral(tamanho*percent)/100.0
tamanho = length regs

Expand Down
6 changes: 5 additions & 1 deletion main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import CentroidClassifier
import NearestNeighbor
import ClassifierAnalysis
import Text.Printf
import System.IO


{-
Primeiro trabalho computacional de Programação Funcional em Haskell. Realiza o treinamento de dois classificadores
Expand All @@ -12,7 +14,9 @@ import Text.Printf
-}

main :: IO ()
main = do --leitura dos parametros de entrada
main = do -- Impedir buffering para escrever todas as mensagens na tela
hSetBuffering stdout NoBuffering
--leitura dos parametros de entrada
putStr("Forneca o nome do arquivo de entrada: ")
entrada <- getLine
putStr("Forneca o nome do arquivo de saida: ")
Expand Down
2 changes: 2 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
all: main.hs
ghc -no-keep-hi-files -no-keep-o-files main.hs

0 comments on commit d925d78

Please sign in to comment.