-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatternfile.hs
More file actions
2813 lines (2408 loc) · 162 KB
/
Patternfile.hs
File metadata and controls
2813 lines (2408 loc) · 162 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--This module exports a Patternfile-Reader and a Patternfile-Writer
--a Patternfile is a txt file with
-- line-format: type:String
-- (val,year,month,day) e.g > (0.59,16,Apr,9)
--statisticalAnalysisWriteWxMaxima3 -
module Patternfile (
writePatternFile -- Patternfile-Writer
, aMemoryRAW -- Patternfile-Reader
, aMemoryBat
, aOsZilloskop1 -- less options write Display in wxm
, aOsZilloskop1KEY -- perform with full keyboard IO
, aOsZilloskop1RAW -- write Display in wxm
, foOutput -- select between yes-output vs no-output
, foOutputRAW -- if ==1 do normal action, (action could be IO but maybe String??)
-- if /=1 do a different action
, ausw -- get sth from a list
, aCrunchList1 -- get overview and most rudamentary plotter that even works in HTA
, aCrunchList1RAW -- same as above but hides output
, aCrunchList1KEY -- as above with full keyboard IO
, timeRNDInts
, avanti
, selectFuncL -- test 'upfire' Global Variable
-- , originalTxt
) where
-- import System.Data
import System.Random
import System.Environment
import System.IO
import Data.Char
import Data.List
import Control.Monad
import Data.Time as T
import System.Locale
-- my modules
import Diff_Functions1 as Df
import Fourier_Functions1
import WriteWXmaximaFile
import GUIMenuGHCtext
import qualified UsefulFunctions as Us hiding(zufallsBasic1,takerleiN)
--rnd gnerator and time
zufallsBasic1 t a x = (take t (randomRs (1,a) (mkStdGen x)))::[Int]
timeRNDInts foTime soMany digits = let prepStringtoInt = (map chr (filter (<58)(filter (>47)(map ord (show foTime)))))
in let plugRandom wieviele = zufallsBasic1 wieviele (read prepStringtoInt) digits
in (show (plugRandom soMany))
-----------------------------------------------------
--Global Variables
root = "c:/stack/Stream-Crypt19/"
token = 4 -- how many buttons to insert
bild1 = "c:/stack/forGlade/src/Many3.html" -- a storage file conected to 'Colored_2_3_5_Counter.hs'
writeHTAorHTML = 1 -- if == 1 then write HTA
fostartLine = "1" -- startline pattermfile-reader in 'aMemory'
foendline = "3000"-- endline patternfile-reader in 'aMemory'
rnd = "100" -- for random number generator
fomuster = "1" -- set to val
fohans = "7" -- Enter a value that does not occure and see its propability , set to fixed value
autoInp = "1"
entersCSV = "durble.csv"
selectFuncL = ( show [1,2,3,4,5])
--fostatiswa g = g
--fostatiswa = do
-- asd <- getLine
-- unwords (lines(ffostatiswa (read asd) ))
-- dipfade2
-- fourier3
-----------------------------------------------------
--SelectorFunctions
ausw w fa = drop (w-1) (take w fa)
takerleiN w fa = ausw w fa
takerlein w fa = takerleiN w fa
getRid x = let a = (( x))
in let b = reverse a
in let c = truncate (read b)
in c
-----------------------------------------------------
--'searchCrit' must be part of the given DATA Set to succeed
-- 'searchCrit':String ; e.g> "0.56"
searchCrit = "0.56"
-- fi:String which file to read e.g> "seniot.txt"
searchCritAdvance fi = do
anyWalk <- readFile fi
let bobbo2 = ([(read fostartLine)..(read foendline)])
dipfade2 <- forM (bobbo2) (\ a -> do
let auswahl = let an =takerlein a (lines anyWalk)
in an
let val = let an = cvsZeilenBrea (concat auswahl)
in let boss = filter (>40) an
in let go = map chr boss
in go
let process = (concat auswahl) \\ show val
let findYear = let an = (cvsZeilenBrea2 (process))
in map chr an
let year = jahr findYear
let finddate = let an = (cvsZeilenBrea3 (process))
in map chr an
let monat = month finddate
let tag =day finddate
let modus = if (read fomuster) == 1 then val --choose value
else if (read fomuster) == 2 then year
else if (read fomuster) == 3 then monat
else if (read fomuster) == 4 then tag
else val
let dataTyp = (modus)
return (dataTyp) ) --a also nur zahlen
let criterium = searchCrit
let maxO = (maximum (dropWhile (\(val) -> val < criterium ) ( dipfade2)))
putStrLn (" the data is (ohne die extra Leerzeile) : " ++ maxO)
------------------------------------------------------------------------------
--CHANGE OUT
foOutput output paks = foOutputRAW output paks (putStrLn "")
foOutputBat output paks = foOutputRAW output paks ("")
foOutputRAW output paks pac = if output=="1"
then do
paks
else do
pac
------------------------------------------------------------------------------
-- CHANGE IO
fochangeOut1 autoInput solong globalVar aTxT = do
let customL = [1..(read solong)]
doesTaht <- forM (customL) (\presetList -> do
if autoInput=="1"
then do
morM <- forM [1] (\gu -> do
putStrLn aTxT -- e.g "Enter csv file to read"
exportThis <- getLine
-- let goAhead inserT1 = (foFunction inserT1)
-- let inCompute = goAhead exportThis
-- inCompute
return (exportThis))
putStrLn (unlines morM)
else do
putStrLn globalVar
return ())
return()
--------------------------------------------
-- Write an simple csv reader
----------------------------------------------------------
-- enter output:String, if outPut==1 then print else not
-- enter xRaw , the name of the Patternfile
-- entername of the returned File, NF
-- enter Begin und End Lines as "Int" ( a String representing an Int)
-- enter Criterium as a String !!! BEARBEITET AB/einschlieslich ERSTES KRITERIUM!!!!
-- returns Max und Min Val
-- returns Spot of Max vals with regards to the criterium
-- returns based on dipfade4 (Ocourance of the Groups a values ordered by their value
-- returns given values of the Spektrums of 0.56(min)...max, and its propability of ocourance
-- returns missing values of the Spektrum
-- xRaw:String, patternfilet.txt to read
-- [xRaw,
solonGs = [1]
--SUBSTITUTE all foOUTPUS
aMemoryBat = aMemoryRAW "1" (root++"senio.txt") (root++"senio2.txt")
aMemoryRAW output xRaw nF = do
-- putStrLn$ "Enter starting Line:"
let anfang = "1" --fostartLine -- anfang <- getLine
-- putStrLn$ "How many Lines to change?:"
let xX = "365" --foendline -- xX <- getLine
-- database <- readFile "milch.txt"
--let machAdd f = add [ nF, f]
anyWalk <- readFile xRaw -- z.b. "mageWalAllPath.txt"--durble.csv
-- machAdd dataTyp
--let bilderno = length anyWalk
let bobbo = ([(read anfang)..(read xX)])
dipfade <- forM (bobbo) (\ a -> do
let auswahl = let an =takerlein a (lines anyWalk)
in an
let val = let an = cvsZeilenBrea (concat auswahl)
in let boss = filter (>40) an
in map chr boss
let process = (concat auswahl) \\ show val
let findYear = let an = (cvsZeilenBrea2 (process))
in map chr an
let year = jahr findYear
let finddate = let an = (cvsZeilenBrea3 (process))
in map chr an
let monat = month finddate
let tag = day finddate
let mo3 = show(unlines(words finddate))
let spuren = (einTyp2 (getRid (val)))
let dataTyp = (show spuren) --)++"\n"-- (show apunkt)++ "(Just "++(show tag)++ (show monat) ++ ")\n"
let procIntern = head spuren
return (dataTyp) ) --a also nur zahlen
let collOut1 = foOutputBat output (unlines[" the data (without empty spaces) : "])
let collOut2 = foOutputBat output (unlines(dipfade))
-- add [nF, (concat dipfade)]
-- writeFile nF (concat dipfade)
-- putStrLn "enter what to edit val:1 ; year:2 ; month:3 ; tag:4 einfach Int eingeben"
let muster = fomuster
-- putStrLn " enter criterium: that is a value (nur Int eingeben)"
let criterium = searchCrit -- criterium <- getLine ----------------------------********************* SEARCH ONE VAL IN THE SET
let bobbo2 = ([(read anfang)..(read xX)])
dipfade2 <- forM (bobbo2) (\ a -> do
let auswahl = let an =takerlein a (lines anyWalk)
in an
let val = let an = cvsZeilenBrea (concat auswahl)
in let boss = filter (>40) an
in let go = map chr boss
in go
let process = (concat auswahl) \\ show val
let findYear = let an = (cvsZeilenBrea2 (process))
in map chr an
let year = jahr findYear
let finddate = let an = (cvsZeilenBrea3 (process))
in map chr an
let monat = month finddate
let tag =day finddate
let modus = if (read muster) == 1 then val --choose value
else if (read muster) == 2 then year
else if (read muster) == 3 then monat
else if (read muster) == 4 then tag
else val
let dataTyp = (modus)
return (dataTyp) ) --a also nur zahlen
-- putStrLn " the data is (ohne die extra Leerzeile) : "
-- putStrLn (show dipfade)
-- let bobbo2 = ([(read anfang)..(read xX)])
let wievieleMx = length(snd (partition (>criterium) (dropWhile (\(val) -> val < criterium ) ( dipfade2))))
dipfade3 <- forM (bobbo2) (\ a -> do
let auswahl = let an =takerlein a (lines anyWalk)
in an
let val = let an = cvsZeilenBrea (concat auswahl)
in let boss = filter (>40) an
in let go = map chr boss
in go
let process = (concat auswahl) \\ show val
let findYear = let an = (cvsZeilenBrea2 (process))
in map chr an
let year = jahr findYear
let finddate = let an = (cvsZeilenBrea3 (process))
in map chr an
let monat = month finddate
let tag = day finddate
let modus = if (read muster) == 1 then val --choose value
else if (read muster) == 2 then year
else if (read muster) == 3 then monat
else if (read muster) == 4 then tag
else val
let punkte name a1 a2 a3 a4 a5 = Punkt name a1 a2 a3 a4 a5
let apunkt = punkte val Nothing Nothing Nothing Nothing Nothing
-- seeit <- getLine
let apunkt2 = apunkt
let dataTyp3 = (apunkt)
return (dataTyp3) ) --a also nur zahlen
let collOut3 = foOutputBat output (unlines [" last issue where lines get a reference list : "])
-- putStrLn (show dipfade)
let more = ((dropWhile (\(val) -> val < criterium ) ( dipfade2)))
let laengeSet = length (dropWhile (\(val) -> val < criterium ) ( dipfade2)) --wie lang ist set
let maxO = (maximum (dropWhile (\(val) -> val < criterium ) ( dipfade2)))
let minO = (minimum (dropWhile (\(val) -> val < criterium ) ( dipfade2)))
let wievieleMx = length(snd (partition (>criterium) (dropWhile (\(val) -> val < criterium ) ( dipfade2))))
let wostehenMx = criterium `elemIndices` (dropWhile (\(val) -> val < criterium ) ( dipfade2))
let comparePosition = let hochundtiefPunkt = if ""++(show laengeSet) == (criterium) then putStrLn "Found Maximal/Minimal Turning Point"
else putStrLn "\n\n\nNo Max or Minimal Turning Point found"
in hochundtiefPunkt
-- mapM print (dipfade2)
let collOut4 = foOutputBat output (unlines[("just red set of length:"++ (show laengeSet) ++ " where is the criterium in the Sets\n")++
((show maxO) ++" maximum value of the Sets\n" )++
((show minO) ++ " minimm value of the Sets\n")++
((show wievieleMx)++ "how many maxima\n")++
((show wostehenMx)++ " where are the maxima\n\n")])
-- let mowork = filter
-- comparePosition
let lister2 = let a= maxO
in let b = (read a)
in let a2 = (read minO)
in let c = ((b)-0.01)
in let d = [(b),(c)..(a2)]
-- in let e = drop 4 (take 5 d)
in let f = map round (map (*100) d)
in f
let fuerdieFehlen = let a= maxO
in let b = (read a)
in let a2 = (read minO)
in let c = ((b)-0.01)
in let d = [(b),(c)..(a2)]
in d
-- let neen er = let b = map er lister2
-- in b
let wos = group more
-- let numliste = let a =
let spuren g h= (einTyp3 (getRid (g h)))
dipfade4 <- forM (bobbo2) (\ a -> do
let auswahl = let an = drop (a-1) (take a (wos))
in ( an)
let rosi = ( take 1 (map length (concat auswahl)))
let dataTyp3 = (auswahl)
return (dataTyp3) )
let zui = map length (group (concat (sort (concat dipfade4))))
let zui11 = (map head (concat dipfade4))
let zui1 = map length (group (concat (concat dipfade4)))-- die val in Zeitgruppen eines Intervalls
let zuu2 = sort (nub ((concat((concat dipfade4)))))
let zuu22 d = map round (map (*100) d)
let zuu3 = (lister2 \\ (zuu22 (map read zuu2)) )
-- putStrLn (show(dipfade2))
-- putStrLn (show more)
let collOut5 = foOutputBat output (unlines( [(show (lister2)++" the 'spectrum' including max und min in 0.1 steps\n\n")++
((show dipfade4)++ " Data of computation (run) 'dipfade4' needed for propability calculation\n\n")++
((show zui1)++ " the occouring groups of numbers ordered in TIME\n\n ")++
((show zui11)++" The values of the groups of numbers (see above)\n\n")++
((show zui)++ " The ocourance of values in spectrum min to Max\n\n")++
((show zuu2)++" Occuring values connected with th line above(s.a)\n\n")++
((show zuu3)++" Not occuring values of the Set x 100\n" ) ] ))
let normWahrsch = let spektrum = lister2 --schliesst das ansolute min und max ein
--- 0 -> nuller Set um dem Computer Raum zu geben Werte zu
-- max
-- min
-- 0 waehlen im Backtest die noch NICHT vorkamen
in let extra = let a = length lister2
in let b = a
in let c = concatMap (replicate b) [0..0]
in [c,lister2,c]
in extra
let normWahrsch1 = let dieZeut = sum zui1
in let dieAkteure = zui
in let rechner = let a z t = z/t
in a 1 2
in [[dieZeut], zui]
let form t c z = (100/(t+(2*c)))* z
let formelNormWahr dr = let a1 = let mitSpielraum = (length lister2)
in let dieZeut = ( sum zui)
in show dieZeut
in let a2 = show (length lister2)
in let a3 = zui
in let b1 i ii iii = show (form i ii iii)
-- in let b2 = b1 (a1 a2 (head a3))
in b1 (read a1) (read a2) dr --[[a1],[a2],a3]
let hans = fohans -- enter non realized values , will be put
let gogos = let a = map show zui
in let b = map formelNormWahr (map read a)
in b
let heet = length( gogos)
let zurWahr de = let a0 de = head de
in let a1 de = de \\ [(a0 de)]
in let a2 = iterate a1 de
in (take heet a2)
-- let gogo3 = let a = map ord gogo2
-- in let b = filter (=='"') a
-- in a --b
-- let zurWahr2 = ((zurWahr gogos))
-- let a0 de = (head de)
--in let a1 de = (de) \\ [(a0 de)]
--in let a2 = iterate a1 de
--in let a3 = ((take heet a2))
-- map read gogos
------------------------------------------------- +++++++++++++++++++++++++++++++++++ inserted 08-08-2019
---------------------------------------------------------------
--Monade RANDOMGENERATORS/PROPABILTYGENERATORS
-- in diade vals are given to then random number generator
-- in order to give to (val,zeit)-pairs an individual id
let gogo2 = gogos
let bobbo44 = ([(read anfang)..(read xX)])
diade <- forM (bobbo44) (\ a -> do
let auswahl = let an =takerlein a (lines anyWalk)
in an
let val = value auswahl
let process = (concat auswahl) \\ show val
let findYear = let an = (cvsZeilenBrea2 (process))
in map chr an
let year = jahr findYear
let finddate = let an = (cvsZeilenBrea3 (process))
in map chr an
let monat = month finddate
let tag = day finddate
let mitZufall t x c = zufallsGen4 t x c -- :520
--determines an individual Int value for lines is just applicable ones per set
--because its outut doesnt change not again
let signatur = let a = 100* (read val)
in truncate (sum [a , (read tag ) , (read year),(monthTime monat)])------------------------------------------INPUT TO MANPULATE RANDOM NUMBER GENERATOR
--determines the length of list of which the random generator is fed
let makene = (length dipfade2)
let einsatz = mitZufall makene (read rnd) (signatur)
let dataTyp = (show einsatz)
--greatSpectrum with formula : form2
let bert = formelNormWahr (read val)
let chooser = let a1 ert= drop (a-1)(take a ert)
in let b1 = (show (a1 einsatz))
in let c1 = (a1 bert)
in let b11 = let ans = (map ord b1)
-- filtert "
in let bns = filter (>35) ans
in let bnf = filter (<91) bns
in map chr bnf
-- in if b11<=c1 then b1
-- else (b11) -- ansatz zum berechnen von TAKER fuer % auswahlfu
in (b11)
let chooser2 = let nutzeAlle = filter (/= a) [1..makene] -- show all Randoms chooser didnt use.
in (nutzeAlle ) --mehr) --(nutzeAlle) --(hohlRando 1) ---b11 a)-- (meinA 2) --ungenutzte -- nutzeAlle --(meinA (4)) --nutzeAlle --( ungenutzte)
return (chooser) ) --a also nur zahlen
-- putStrLn ((head diade)) -- 36,31,62
-- : ende grosse Klammer 6254
-- putStrLn (show (diade)++"\n")
let humfrey = let apart = "1" -- (head diade)
in let a1 = (map ord (unlines ( diade)))
--in let a2 = filter (<5) a1
--in let a22 = filter (<57) a2
in (words (map chr a1))
let zulu = humfrey
--- shows example how Rules for Interval can be programmed
let fogorch = (map read (concat(concat dipfade4)))
let gorch = similaritYvalue fogorch [11,12,34,44]
let gorchH = zui
------------------------------------------------------------------------------------
-- BSP fuer String Spektrum umwandlung string -> Int
-- Berechnet die Werte im PICKER d.h. hier wandert
-- eine Zaehlfunktion durch die liste aller Wahrscheinlichkeiten
-- des geg. Sets
-- sie soll Intervalle schaffen durch welche sich der PICKER ORIENTIERT
-- mittels pick < (takerlein n prego) ....Anhand der
let prego xw= let a00 = xw
in let a1 a00= drop (a00-1) (take a00 (zurWahr gogos))
in let a2 = ((show ((concat (a1 a00)))))
in let foPick g = map isNumber g
in let b11 = let ans = (map ord a2)
-- filter punkt
in let bns = filter (>46) ans
in let bnf = filter (<91) bns
in ( map chr bnf) -- map digitToInt ( map chr bnf)
-- in map
--
--WWWWWWWWWWWWWIIIIICCCHHHTIIIIIIIIGGGGG
in let b22 = let am = map digitToInt b11 -- schafft Int fuer prozess
in let am2 = am --prozentrechnung
in am2
in let b3 = let a2 = (take 2 b22)
in sum (zipWith (*) [1,1] a2)
in let b33 = let a21 = take 2 b22
in let a3 = sum (zipWith (*) [10,1] a21)
in let bhz = (drop 2 )(take 4 b22)
in a3
-- in let b44 = take 4
in let a5 = let a2a = take 4 b22 --Int
in let a2aa = drop 3 (take 4 a2) -- String
in let a4 = head (drop 3 a2a) -- Int
in let a4a = head (drop 2 (take 3 b22))
-- in let teilerr = [(nullStell a4a a4)]
in if ((foPick ( a2aa))== [True]) then [b33]
else let zuuu = b33 --a2a--(a4/10)
in (take 1 b22) --zuuu --a2aa
in a5 -- (take 7 a2) --picker --(a2,b11,b22,b3,picker)
----------------------------------------------------------------------------
-- ALTERNATIVE Approach Formulas: prego,
-- th attempt is to change form random gen in simulateed values
let chgeWahr2Prego = let --a1 d = prego d
-- recurse2Str x y = (\x y -> [x,y])x y
-- recurse1Str x = (\x -> [x]) x
a2 = ((show gogos)) --(unlines gogos)
filtern = let a11 = (map ord a2) -- [Str] -> [Int]
a22 = filter (/=34) a11 --filter ""
in map chr a22 --(map chr a22)
in (filtern) -- a2 --(filtern) --(a1 d)
let addder = let zdr = (chgeWahr2Prego)
in ( zdr)
------------------------------------------------------------
let fert f = let a1 = [1..(length gogos)]
in let b1 = concat (map f a1)
in let nehmer n = take n b1
in let giver = map nehmer a1
in map sum giver --map sum giver
let gert f = let a1 = [1..(length gogos)]
in let b1 = concat (map f a1)
in let nehmer n = take n b1
in let giver = map nehmer a1
in giver --map sum giver
let bro n= let a1 = bobbo
in let nehmer n m = take n m
in let zufall1 n = nehmer n (fert prego)
in let zufall2 n = nehmer n humfrey
in let valuees n= nehmer n zuu2
in let giver1 = last (map zufall1 a1)
in let giver2 = last (map zufall2 a1)
in let gurt n = let zfg = (length (concat(drop (n-1) (take n giver2))))
in zfg
in let picker = map gurt a1
in picker --(giver1,giver2,givVal,chngeStr,gurt n, picker) --map sum giver
--diese Funktion wandelt die zufallsliste aus zufallsgen -> String
--in Int um , xw= Int , wird in gert gemapped
let preAI xw g = let im1 = bobbo
in let nehmer n m = take n m
in let zufall1 n = nehmer n (fert prego)
in let zufall2 n = nehmer n humfrey
in let valuees n= nehmer n zuu2
in let giver1 = last (map zufall1 im1)
in let giver2 = last (map zufall2 im1)
in let givVal = last (map valuees im1)
in let
in let a00 = xw
in let a1 a00= drop (a00-1) (take a00 (giver2))
in let a2 = ((show ((concat (a1 a00)))))
in let foPick g = map isNumber g
in let b11 = let ans = (map ord a2)
in let bns = filter (>46) ans
in let bnf = filter (<91) bns
in ( map chr bnf) -- map digitToInt ( map chr bnf)
-- in map
------------------------------------------------------------------ ****************** art of Main aMemory Pipe
in let b22 = let am = map digitToInt b11 -- get Ints for process
in let am2 = am --prozentrechnung
in am2
in b22 -- (take 7 a2) --picker --(a2,b11,
--mapped preAI abhaengig von laenge wahrscheinlichkeits liste zum abzaehlen
let eindelijk f = let ar fu = (preAI fu 1)
in let ar2 fu = length (ar fu)
in let arGo = map ar bobbo44
in let rech fu = sum(zipWith (*) [10,1] (ar fu))
in if ((ar2 f) == (2) ) then rech f
else sum (ar f)
let eindelijkGo = map eindelijk bobbo
let ghijst n = let art z = drop (z-1) (take z eindelijkGo)-- int zufallsgen vorkommnis
in let art2 z = drop (z-1) (take z (fert prego)) -- int abzaehlliste
in let art22 z = drop (z) (take (z+1) (fert prego)) -- int abzaehlliste
in let art23 z = drop (z+1) (take (z+2) (fert prego)) -- int abzaehlliste
in let art3 z = drop (z-1) (take z (zuu2))-- val die vorkommen
in let bart = (map art bobbo)
in let bart2 = ( map art2 bobbo)
in let bart22 = (map art22 bobbo)
in let bart23 = (map art23 bobbo)
in let rtzu = sort (concat [((art n)), (fert prego)])--spektrum mit vorkommnis
in let fowo g t = (head (g t))
in let gthe = let gds = partition (<= (fowo art n)) rtzu
in gds
in let gthe2 = length (fst gthe)
in let gthe3 = art3 gthe2
in ((art n , gthe), (gthe2, gthe3))
let goghijst = let wer k = (snd(snd (ghijst k)))
in (map wer bobbo)
--let gerri = (map ghijst bobbo)
let addIA d gz = let theOther = d : (fert gz)
in theOther
-- putStrLn (show normWahrsch)
-- putStrLn (show normWahrsch1)
let collOut6 = foOutputBat output (unlines [((show zui)++ " occurance of val-GROUPS sorted Min to Max\n\n")++
((show zuu2)++" Apearing number in relation to see above (s.a)\n\n")++
(( formelNormWahr (read hans))++"% Of non realized vals of a set \n\n")++
(show ( gogos)++"% Dies ist die Liste mit Formel 1 wahrscheinlichkeiten ; function: gogos\n\n")++
-- putStrLn (show ( heet)++"% gesamt wahrscheinlichkeiten ")
-- putStrLn (show ( zurWahr gogos )++"zurwahrliste schafft PICKER fuer % ; function: zurWahr gogos ")
-- putStrLn (show (gorch )++"Ahenlichkeit wahrscheinlichkeit ")
--putStrLn (show (gorchH )++" ")
-- putStrLn (show ( humfrey )++"BSp bereinigtes Format string aus monade; function: humfrey ")
(show (prego 1)++ " BSP Prozentrechener als Int leider nur fuer ganze zahlen; function: prego 1\n\n" )++
(show (fert prego )++ " The additve list for a counter und vizualising change propabilities "++ "; function: fert prego\n\n" )++
-- putStrLn (show (bro 1 ) ++ " vergleich von Zaehler und Zufallsgenerator")
-- putStrLn (show (preAI 2 2 ) ++ " vergleich fuer Zufallsgenerator einzelne zahl")
-- putStrLn (show (eindelijkGo ) ++ " vergleich fuer Zufallsgenerator liste gogos")
(show (addIA 1729 prego ) ++ " fuegt prozent der additiven liste zu; function: addIA 1729 prego\n\n")++
-- putStrLn (show (ghijst 1 ) ++ " test fuer map additive Liste mit zufall ")
-- putStrLn (show (goghijst ) ++ " s.o. Liste " )
((show normWahrsch)++"\n\n")++
((show normWahrsch1)++"\n\n")++
(( formelNormWahr (read hans))++"% The propability to unrealized values in percent\n\n")++
(show ( gogos)++"% The List of Formula-1 propabilities\n\n ")++
(show ( heet)++"% total of all propabilities\n\n ")++
(show (head( zurWahr gogos ))++"a Counter \n\n")++
-- putStrLn (show (gorch )++"Ahenlichkeit wahrscheinlichkeit ")
--putStrLn (show (gorchH )++" ")
-- putStrLn (show ( humfrey )++"BSp bereinigtes Format string aus monade; function: humfrey ")
--putStrLn (show ( (prego 1))++ " BSP Prozentrechener als Int leider nur fuer ganze zahlen; function: prego 1 " )
(show ((fert prego ) )++ " Die Additive Liste zum Abzaehlen und einfuegen von Wahrscheinlichkeitsaenderung\n"++ "; function: fert prego\n\n")] )
-- putStrLn (show (bro 1 ) ++ " vergleich von Zaehler und Zufallsgenerator")
-- putStrLn (show (preAI 2 2 ) ++ " vergleich fuer Zufallsgenerator einzelne zahl")
-- putStrLn (show (eindelijkGo ) ++ " vergleich fuer Zufallsgenerator liste gogos")
-- putStrLn (show (addIA 1729 prego ) ++ " fuegt prozent der additiven liste zu; function: addIA 1729 prego")
-- putStrLn (show (ghijst 1 ) ++ " test fuer map additive Liste mit zufall ")
-- putStrLn (show (goghijst ) ++ " s.o. Liste " )
-- putStrLn (show ( gogo3 )++"fuer waehler ")
--x nF crit --openB file to open ; -openA file to write ; forD criterium
------------------------------------------------------------------------------------OSZILLOSKOP SHOS INPUT AND RANDOM
let mixWithMQ4 = let ay2 p = fourier1MQ4 p + fourier2MQ4 p + fourier3MQ4 p + fourier4MQ4 p
in let ay3 = (6.28319901) -- NullStelle Des Intervals
in let ay4 = (ay3/ (read xX)) -- takes forC howmany lines
in let soMany2take fak = ay4 * fak -- determines which value of fourier123 2 select
in let forThis fak = fourierMQ4PAN (soMany2take fak)
in let fofoThis = map forThis [1..(10)]
in fofoThis --intoConsider
-- lists real values or simulated ones into a function
-- inotConsider -> realVals or simulVals -> g -> function (g)
{- let intoConsider = let inpU2 = (concat goghijst) -- quelle simulierte vals
in let inpU3 = (map show bobbo) -- laenge val liste
in let inpU4 = concat (concat dipfade4) -- real Input VALS
in let inpU5 = (zipWith (+) ( mixWithMQ4) (map read humfrey)) -- fourier123 and simulated vals
-- in let inpU6 = (zipWith (+) ( mixWithMQ4) (read inpU4)) -- fourier123 and REAL input vals
in [inpU2,inpU3,inpU4,inpU5] -}
{-
let outPutMaxima3 x = let generateList x0 = [Df.differenzwerte x0, Df.differenzwerte3 x0,Df.differenzwerte4 x0,Df.differenzwerte5 x0,Df.differenzwerte6 x0,Df.differenzwerte7 x0]
in let ofLength = map generateList [1..(x)]
-- in let fourier4 = head (ausw 3 intoConsider) -- fourier (realVals)
in let realVals = (concat goghijst) -- the realVals
-- will make neat lists of length 2 that represent one 'discrete 2dplot' point derived from rigt above
-- as list of point -> passed to "file2Write.wxm"
in let kerry x y = zipWith (\x y -> [x,y]) x y -- a-- (zip a b)
in let fofiltern x y= show (kerry x y)
in let filtern xOn y = let tussenstap = map ord (fofiltern xOn y)
tss2 = filter (/=34) tussenstap
in map chr (tss2)
in [(filtern xOn ofLength),(filtern xOn ofLength)] -- ,Df.differenzwerte4 x,Df.differenzwerte5 x,Df.differenzwerte6 x,Df.differenzwerte7 x]
-}
let collOutput = [collOut1,collOut2,collOut3,collOut4,collOut5,collOut6]
avanti (collOutput)
writeFile "screenI.txt" (unlines (collOutput))
avanti pointCloudtext0
foCloudD <- getLine
let sleCloud = if foCloudD=="1"
then do
writeFile "lala.wxm" (writeMQ6ScreenI 10 (read xX) "1")
else if foCloudD=="2"
then do
writeFile "lala.wxm" (writeMQ6ScreenI 10 (read xX) "2")
else if foCloudD=="3"
then do
writeFile "lala.wxm" (writeMQ6ScreenI 10 (read xX) "3")
else if foCloudD=="4"
then do
writeFile "lala.wxm" (writeMQ6ScreenI 10 (read xX) "4")
else if foCloudD=="6"
then do
writeFile "lala2.wxm" (writeMQ6ScreenII 10 (read xX))
else if foCloudD == "5" then do putStrLn "Going Back"
else putStrLn "Error: enter other command"
sleCloud
--------------------------------------------------------------------------------------------------------------------------------
-- APLLIES A FUNCTION to input data and exports them to wxmaxima
-- a function can be applied to evey data point (x y)
xOn = [[1.0,2.0,3.0]]
-- recieves: the real values (realVals):[String]
-- the simulated (simuVals) (not realized yet)
-- 'intoConsider' the fourier Stream : [String]; applied to realVals or simuVals
--Step4
--Zeilenbreak criterium fuer CVS datei
--access to date: day
cvsZeilenBreak s = let a = map ord s --ord '-'=45
in let teile = takeWhile (/=45) a
in teile
--acces to date: Month,year
cvsZeilenBreak2 s = let a = map ord (s) --ord '-'=45
in let teile = takeWhile (>=45) a
in teile
--acces to val
cvsZeilenBreak3 s = let a = map ord (s) --ord '-'=45
in let teile = dropWhile (>=45) a
in teile
cvsZeilenBreak4 s = let a = map ord (s) --ord '-'=45
in let teile = dropWhile (>45) a
in teile
--Step4
--Acces 4 readymade Pattern files
--Zeilenbreak criterium fuer CVS datei
--access to date: day
cvsZeilenBrea s = let a = map ord s --ord '-'=45
in let teile = takeWhile (/=44) a
in teile
--acces to val
cvsZeilenBrea2 s = let a = map ord (s) --ord '-'=45
in let teile = break (>=57) a
in fst teile
--acces to val
cvsZeilenBrea3 s = let a = map ord (s) --ord '-'=45
in let teile = break (>=57) a
in snd teile
cvsZeilenBrea4 s = let a = map ord (s) --ord '-'=45
in let teile = dropWhile (>45) a
in teile
--writes new Patternfile
--fills it with Data: val,year,month,day
--from input CSV x
--x: CSV-RAW (string) ;
--nF: name file open file as string
--starts 2. Line see bobbo, PAtternfile
--
--Bobbo will be further processed
--starts [2.... ends 50]
writePatternFile nF = writePatternFileRAW entersCSV nF --
writePatternFileIOBat = do -- ******************************************************************************************************** A Full Bat pipe
putStrLn "Enter cvs file"
theCvs <- getLine
theCVS <- readFile theCvs
putStrLn "File to write"
toWrite <- getLine
toPATTERN <- readFile toWrite
putStrLn "How many to take"
takS <- getLine
writePatternFileRAW (root++theCvs) (root++toWrite)
checks <- readFile (root++toWrite)
let seeCrit = head (words checks)
aCrunchList1 (root++toWrite) (root++"senio2.txt") (takS) seeCrit --- senio7.txt pipes
putStrLn "Enter a random number for simulation"
theRND <- getLine
aOsZilBat theRND
-- aCrunchList1 (root++"senio2) (root++"senio2.txt") (takS) seeCrit
writePatternFileRAW x nF = do
-- database <- readFile "milch.txt"
--let machAdd f = add [ nF, f]
anyWalk <- readFile x -- z.b. "mageWalAllPath.txt"--durble.csv
let leane = length (lines anyWalk)
let startline = "2" -- startLine <- getLine
-- putStrLn ("Enter end line:")
let endline = foendline -- endline <- getLine
-- machAdd dataTyp
--let bilderno = length anyWalk
let bobbo = ([(read startline)..(read endline)])
dipfade <- forM (bobbo) (\ a -> do
let auswahl = let an = takerlein a (lines anyWalk)
in an
let tag = let an = cvsZeilenBreak (concat auswahl)
in map chr an
let process = (concat auswahl) \\ show tag
let findYear = let an = (cvsZeilenBreak2 (process))
in map chr an
let year = let an = show findYear
in let b = map ord an
in let c = filter (>45) b --get rid of the commas
in let d = filter (<65) c -- just leave number digits
in map chr d -- only the year number remains
let monat = let an = show findYear
in let b = map ord an
in let c = filter (>45) b --get rid of the commas
in let d = filter (>64) c -- just leave letter digits
in map chr d -- only the month letters remains
let findval = let an = (cvsZeilenBreak3 (process))
in map chr an
let val = let an = show findval
in let b = map ord an
in let c = filter (>45) b
in map chr c
let mo3 = show(unlines(words findval))
let dataTyp = ""++"("++val++","++year++","++monat++","++tag++")\n"
return (dataTyp) ) --a also nur zahlen
putStrLn ("File : "++ x++ "has: "++ (show leane) ++ " Lines\n")
mapM putStrLn (dipfade)
writeFile nF (concat dipfade)
putStrLn ("read : "++ x ++" -> wrote: "++nF++" with: "++(foendline)++" of "++(show leane)++" lines selected")
----------------------------------------------------
----------------------------------------------------
--Example Random Function
-- a :: Int
zufallsGen a x = (take a (randomRs (1,6) (mkStdGen x)))::[Int] -- Random between 1 and 6, of length a always 6 as values
zufallsGen2 a = (take a (randomRs (1,a) (mkStdGen 10)))::[Int] -- Ran. 1 bis a laenge a
zufallsGen3 a = (take a (randomRs (1,(12*a)) (mkStdGen a)))::[Int] -- Ran
zufallsGen4 t a x = (take t (randomRs (1,a) (mkStdGen x)))::[Int]
-- more random number generator functions
tre = random (mkStdGen 12) :: (Int, StdGen)
tre1 = random (mkStdGen 13) :: (Int, StdGen)
tre2 = random (mkStdGen 14) :: (Int, StdGen)
tre3 b = let a1 = random (mkStdGen b) :: (Int, StdGen)
in abs (fst a1)
aRandom x = random (mkStdGen x) -- wird mit
-- ist eine Zahl die drei Werte beinhalted um
-- fuer jede ZAhl aus jedem Set eine Individuelle
-- zahle erzeugt
-- x: name der datei
forRandom x val
= let nameanders = (map ord x)
in let weiter = (concat((map (:val) [(length nameanders)])))
in head weiter --[weiter,weiter2,val,day,month]
----------------------------------------------------
--CSV-related selection and thieving functions for main pipes 'aMemory' and 'writePatternFile'
----------------------------------------------------
weiter2 x = (sum (map ord x))
takeval val = val
takedate day = day
id1 month = month
value ausw= let an = cvsZeilenBrea (concat ausw)
in let boss = filter (>40) an
in map chr boss
jahr findY = let an = show findY
in let b = map ord an
in let c = filter (>45) b --schmeisst kommas raus
in let d = filter (<65) c -- laesst nur Zahlen ueber
in map chr d -- bleiben nur Jahreszahlen
month findda = let an = show findda
in let b = map ord an
in let c = filter (>45) b --
in let d = filter (>64) c -- just leaves letters
in map chr d -- the month letters remain
day dindda = let an = show dindda
in let b = map ord an
in let c = filter (>45) b
in let d = filter (<65) c
in map chr d
--
einTyp f = [((plugit f 2),(stelle2er f)),((plugit f 3),(stelle3er f)),((plugit f 5) ,(stelle5er f))]
einTyp2 f = [((plugit2 f 2),(stelle2er f)),((plugit2 f 3),(stelle3er f)),((plugit2 f 5) ,(stelle5er f))]
einTyp3 f g = [(plugit2 f g)]
--------------------------------------------------------------
--------------------------------------------------------------
--Colored Circles/Colored Spheres
--------------------------------------------------------------
bougaer x= let gaga =(read x)
--in let step1 = counterDreierKugel x
in let tessen = ((gaga)-1)
in let boui = stelle3er gaga -- if (charly x) == True then counterDreierKugel (show tessen)
--else step1
in let step2 = if (boui) == 1 then show "green"
else if (boui) == 2 then show "red"
else "blue" --if (boui) == 3 then show "blue"
in step2
bougaer2 x= let gaga =(read x)
--in let step1 = counterDreierKugel x
in let tessen = ((gaga)-1)
in let boui = stelle3er gaga -- if (charly x) == True then counterDreierKugel (show tessen)
in let step2 = if (boui) == 1 then 1
else if (boui) == 2 then 2
else 3 --if (boui) == 3 then show "blue"
in step2
--
-- The Datatype suited the 2er,3er,5er listes
-- 2er: type: 2 -> [1,2,] [3,4]... with colorcode
-- 3er : type: 3 -> [1,2,3] [4,5,6]... "
-- 5er. type 5 -> [1,2,3,4,5] [6,7,8,9,10] ...
-- is inserted into color giver 'baugaer'
-- y = choose mode 2,3,5
-- x = input
datenTypZahlen y x =( take y (concatMap (replicate x) [1..y]))
datenTypZahlen2 x f = let a = drop (f-1) (take f (concat (take f (repeat [1..x]))))
--in let listel = last (take f a)
in a
--
-- ---------------------------------------------------
-- ENTGUELTIGE FARBAUSGABE DER KUGELN
-- ----------------------------------------------------
-- choose modus s. oben
plugit input chosemodus = let a x = map bougaer (map show x)
in let b = (datenTypZahlen input chosemodus)
in let bbeide = a b
in last bbeide
--------------------------------------------------------------
plugit2 input chosemodus = let a x = map bougaer2 (map show x)
in let b = (datenTypZahlen input chosemodus)
in let bbeide = a b
in last bbeide
--------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------