seqbuild 0.0.30__tar.gz → 0.0.32__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {seqbuild-0.0.30 → seqbuild-0.0.32}/PKG-INFO +1 -1
- {seqbuild-0.0.30 → seqbuild-0.0.32}/pyproject.toml +1 -1
- seqbuild-0.0.32/seqbuild/desi/prng_dec_delta.py +306 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/extraneous.py +4 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/prng_pw_op.py +1 -4
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild.egg-info/PKG-INFO +1 -1
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild.egg-info/SOURCES.txt +1 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/setup.py +1 -1
- {seqbuild-0.0.30 → seqbuild-0.0.32}/LICENSE.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/README.md +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/__init__.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/desi/__init__.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/desi/approximators.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/desi/differentials.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/desi/fraction.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/desi/multi_metric.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/desi/not_equals.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/desi/nvec_gen.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/desi/seqcov_perm.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/__init__.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/cl_guide_parser.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/cmd_proc.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/comm_lang.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/make_cmd.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commlang_guide.md +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_11.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_12error.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_13.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_14.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_15.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_16.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_17.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_18.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_19.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_20.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_21.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_22.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_23.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_24.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_25.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_26.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_27.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_28.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_29.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_30.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_31.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_32.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_33.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_eight.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_five.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_four.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_lcg_cmp.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_lcg_cmp2.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_nine.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_one.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_seven.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_six.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_ten.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_three.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commond_two.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/commondeth.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/dummy_obj.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/example_command.md +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/seqbuild_base_screen.png +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/seqbuild_help_cmd.png +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/seqbuild_help_make.png +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/seqbuild_help_screen.png +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/seqbuild_load_c9.png +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/seqbuild_realtime_command.png +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/seqbuild_show_numbers.png +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sb_ui.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/__init__.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/idectree.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/idt_proc.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/intfactor.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/lcg_v2.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/lcg_v3.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/mdr_v2.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/mod_prng.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/n2mvf_autogen.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/pof_autogen.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/poly_output_fitter_.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/process_seq.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/seq_struct.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/intigers/tvec.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/__init__.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/ag_ext.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/csrch.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/iseq.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/matfactor_eval.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/minmax_freq.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/n2m.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/n2m_function.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/n2m_index.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/ngram.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/nsfr.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/puc.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/sp_op.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/vs_fit.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/vs_fit_mem.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/vs_fit_op.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/mini_dm/vs_srch.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/seqgen/__init__.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/seqgen/gg_gen.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/seqgen/idt_gen.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/seqgen/mdr_gen.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/seqgen/optri_gen.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/seqgen/rch_gen.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/seqgen/sb_crypt.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/seqgen/shadow_gen.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/seqgen/ssi_load.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/seqgen/ssi_netop.py +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild.egg-info/dependency_links.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild.egg-info/requires.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild.egg-info/top_level.txt +0 -0
- {seqbuild-0.0.30 → seqbuild-0.0.32}/setup.cfg +0 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Self-referential algorithms to derive integers from base floats.
|
|
3
|
+
"""
|
|
4
|
+
import numpy as np
|
|
5
|
+
from morebs2.matrix_methods import is_number
|
|
6
|
+
from ..intigers.prng_pw_op import *
|
|
7
|
+
from ..intigers.mod_prng import *
|
|
8
|
+
from copy import deepcopy
|
|
9
|
+
from collections import defaultdict
|
|
10
|
+
from operator import add,sub,mul
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
DEFAULT_PDD_EXCLUDED_NUMERICAL_CHARS = {"e","E",".","-","+"}
|
|
14
|
+
DEFAULT_PDD_EXCLUDED_OPERATING_NUMBER_TYPES = {float,np.float16,\
|
|
15
|
+
np.float32,np.float64,complex,np.complex64,np.complex128}
|
|
16
|
+
DEFAULT_PDD_OPERATING_FLOAT_RANGE = [-10**32,10**32]
|
|
17
|
+
|
|
18
|
+
#------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
def float_to_str__type_exclude_EDOT(f):
|
|
21
|
+
|
|
22
|
+
s = str(f)
|
|
23
|
+
t = ""
|
|
24
|
+
for s_ in s:
|
|
25
|
+
if s_ not in DEFAULT_PDD_EXCLUDED_NUMERICAL_CHARS:
|
|
26
|
+
t += s_
|
|
27
|
+
return str(int(t))
|
|
28
|
+
|
|
29
|
+
#------------------------ methods to select substrings in integers
|
|
30
|
+
|
|
31
|
+
def int_substr_at_index_(I_:str,current_index,length):
|
|
32
|
+
assert type(I_) == str
|
|
33
|
+
assert type(int(I_)) == int
|
|
34
|
+
assert type(current_index) == type(length) == int
|
|
35
|
+
|
|
36
|
+
i0 = current_index
|
|
37
|
+
i1 = (current_index + length) % len(I_)
|
|
38
|
+
|
|
39
|
+
# case: end index cycles back to the prefix
|
|
40
|
+
if i1 < i0:
|
|
41
|
+
p0 = I_[i0:]
|
|
42
|
+
p1 = I_[:i1]
|
|
43
|
+
return int(p0 + p1), i1
|
|
44
|
+
|
|
45
|
+
# case: start equals end
|
|
46
|
+
if i0 == i1:
|
|
47
|
+
return int(I_[i0]), i1
|
|
48
|
+
|
|
49
|
+
# case: proper substring
|
|
50
|
+
return int(I_[i0:i1]), i1
|
|
51
|
+
|
|
52
|
+
def int_split_next__type_sequential_ref(I,current_index,ref_index):
|
|
53
|
+
assert is_number(I,DEFAULT_PDD_EXCLUDED_OPERATING_NUMBER_TYPES)
|
|
54
|
+
I_ = str(I)
|
|
55
|
+
x = int(I_[ref_index])
|
|
56
|
+
return int_substr_at_index_(I_,current_index,x)
|
|
57
|
+
|
|
58
|
+
def int_split__type_current_ref(I,current_index):
|
|
59
|
+
I_ = str(I)
|
|
60
|
+
x = int(I_[current_index])
|
|
61
|
+
return int_substr_at_index_(I_,current_index,x)
|
|
62
|
+
|
|
63
|
+
#--------------------------- methods to derive new integers from an integer
|
|
64
|
+
|
|
65
|
+
"""
|
|
66
|
+
auxiliary method for method<integer_derivation__type_PWO>
|
|
67
|
+
"""
|
|
68
|
+
def integer_derivation__type_PWO_selector_(I,current_index,ref_index=None):
|
|
69
|
+
|
|
70
|
+
first = None
|
|
71
|
+
##print("LEN {} {} {}".format(len(str(I)),current_index,ref_index))
|
|
72
|
+
if type(ref_index) == type(None):
|
|
73
|
+
##print("CURRENT INDEX: ",type(current_index))
|
|
74
|
+
first,current_index = int_split__type_current_ref(I,current_index)
|
|
75
|
+
else:
|
|
76
|
+
first,current_index = int_split_next__type_sequential_ref(I,current_index,ref_index)
|
|
77
|
+
ref_index = (ref_index + 1) % len(str(I))
|
|
78
|
+
|
|
79
|
+
return first,current_index,ref_index
|
|
80
|
+
|
|
81
|
+
"""
|
|
82
|
+
fetches two integer substrings i0 and i1 from I, and performs
|
|
83
|
+
op(i0,i1) to produce a new integer
|
|
84
|
+
"""
|
|
85
|
+
# NOTE: does not check if op(i0,i1) can execute
|
|
86
|
+
def integer_derivation__type_PWO(I,op,current_index,ref_index=None,skip_counts=0):
|
|
87
|
+
assert skip_counts >= 0
|
|
88
|
+
|
|
89
|
+
first,current_index,ref_index = integer_derivation__type_PWO_selector_(I,current_index,ref_index)
|
|
90
|
+
|
|
91
|
+
for _ in range(skip_counts):
|
|
92
|
+
_,current_index,ref_index = integer_derivation__type_PWO_selector_(I,current_index,ref_index)
|
|
93
|
+
|
|
94
|
+
second,current_index,ref_index = integer_derivation__type_PWO_selector_(I,current_index,ref_index)
|
|
95
|
+
return round(op(first,second)),current_index,ref_index
|
|
96
|
+
|
|
97
|
+
#--------------------------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
# NOTE: this is a custom safe division function that defaults to 1 + 42/43 when
|
|
100
|
+
# Python cannot handle the float division of num / denum.
|
|
101
|
+
def safe_div_v2(num,denum):
|
|
102
|
+
try:
|
|
103
|
+
return safe_div(num,denum)
|
|
104
|
+
except:
|
|
105
|
+
return 1 + 42/43
|
|
106
|
+
|
|
107
|
+
# +,-,/,* and weighted custom
|
|
108
|
+
DEFAULT_PDD_PAIRWISE_OPS = [add,sub,mul,safe_div_v2,"w.c."]
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
DEFAULT_PDD_PRIMARY_MOVES = ["cache op",\
|
|
112
|
+
integer_derivation__type_PWO_selector_,\
|
|
113
|
+
integer_derivation__type_PWO]
|
|
114
|
+
|
|
115
|
+
DEFAULT_CACHE_OP_DRAW_SIZE_RANGE = [1,6]
|
|
116
|
+
DEFAULT_PDD_PAIRWISE_OP_WEIGHT_RANGE = (0.,5+54/55-16/17)
|
|
117
|
+
|
|
118
|
+
DEFAULT_PDD_SELECTOR_SKIP_RANGE = [0,6]
|
|
119
|
+
|
|
120
|
+
#--------------------------------------------------------------------------
|
|
121
|
+
|
|
122
|
+
def integer_to_prg_iterable(I):
|
|
123
|
+
assert is_number(I,DEFAULT_PDD_EXCLUDED_OPERATING_NUMBER_TYPES)
|
|
124
|
+
S = list(str(I))
|
|
125
|
+
S = [int(s) for s in S]
|
|
126
|
+
return prg__iterable(S)
|
|
127
|
+
|
|
128
|
+
#--------------------------------------------------------------------------
|
|
129
|
+
|
|
130
|
+
"""
|
|
131
|
+
Iterator takes an initial float f, and outputs floats based on
|
|
132
|
+
selector+delta operations it conducts revolving around f.
|
|
133
|
+
|
|
134
|
+
The procedure for outputting floats:
|
|
135
|
+
- choose one of the moves in `DEFAULT_PDD_PRIMARY_MOVES`.
|
|
136
|
+
-
|
|
137
|
+
"""
|
|
138
|
+
class PRNGDecimalDelta:
|
|
139
|
+
|
|
140
|
+
def __init__(self,f,cache_size=200,enable_base_delta:bool=False):
|
|
141
|
+
s = str(f)
|
|
142
|
+
assert len(s) >= 4, "float must have at least four values"
|
|
143
|
+
assert type(cache_size) == int and cache_size >= 5
|
|
144
|
+
assert type(enable_base_delta) == bool
|
|
145
|
+
|
|
146
|
+
self.f = f
|
|
147
|
+
self.cache_size = cache_size
|
|
148
|
+
self.enable_base_delta = enable_base_delta
|
|
149
|
+
self.s = float_to_str__type_exclude_EDOT(f)
|
|
150
|
+
|
|
151
|
+
self.primary_move_list = deepcopy(DEFAULT_PDD_PRIMARY_MOVES)
|
|
152
|
+
self.pw_op_list = deepcopy(DEFAULT_PDD_PAIRWISE_OPS)
|
|
153
|
+
|
|
154
|
+
self.queue = []
|
|
155
|
+
self.cindex = 0
|
|
156
|
+
self.rindex = 0
|
|
157
|
+
self.start()
|
|
158
|
+
|
|
159
|
+
return
|
|
160
|
+
|
|
161
|
+
def choose_pairwise_operator(self):
|
|
162
|
+
x = DEFAULT_PDD_PAIRWISE_OPS[self.rindex % len(DEFAULT_PDD_PAIRWISE_OPS)]
|
|
163
|
+
self.rindex = (self.rindex + 1) % len(self.s)
|
|
164
|
+
|
|
165
|
+
if x == "w.c.":
|
|
166
|
+
return self.generate_weighted_pairwise_operator()
|
|
167
|
+
return x
|
|
168
|
+
|
|
169
|
+
def generate_weighted_pairwise_operator(self):
|
|
170
|
+
# fetch four numbers
|
|
171
|
+
N = []
|
|
172
|
+
for i in range(4):
|
|
173
|
+
d = self.deciding_int()
|
|
174
|
+
N.append(d)
|
|
175
|
+
self.rindex = self.rindex + 1
|
|
176
|
+
prg = prg__iterable(N)
|
|
177
|
+
pw_op = prg__one_weighted_pairwise_operator(prg,DEFAULT_PAIRWISE_OPS,\
|
|
178
|
+
DEFAULT_PAIRWISE_OPS,weight_range= DEFAULT_PDD_PAIRWISE_OP_WEIGHT_RANGE)
|
|
179
|
+
|
|
180
|
+
return pw_op
|
|
181
|
+
|
|
182
|
+
def __next__(self):
|
|
183
|
+
self.cindex = self.cindex % len(self.s)
|
|
184
|
+
|
|
185
|
+
action = self.choose_act()
|
|
186
|
+
i = self.deciding_int()
|
|
187
|
+
i2 = None
|
|
188
|
+
|
|
189
|
+
if action == integer_derivation__type_PWO_selector_:
|
|
190
|
+
i2 = self.fetch_substr(i)
|
|
191
|
+
|
|
192
|
+
elif action == integer_derivation__type_PWO:
|
|
193
|
+
i2 = self.pairwise_op_with_skipped_selections(i)
|
|
194
|
+
else:
|
|
195
|
+
i2 = self.pairwise_ops_on_queue_elements(i)
|
|
196
|
+
|
|
197
|
+
self.queue.append(i2)
|
|
198
|
+
self.s = self.s[::-1]
|
|
199
|
+
self.update_queue()
|
|
200
|
+
return i2
|
|
201
|
+
|
|
202
|
+
#--------------------------------- primary move: substring selection of integerized float
|
|
203
|
+
|
|
204
|
+
"""
|
|
205
|
+
obtains a substring from `s`
|
|
206
|
+
"""
|
|
207
|
+
def fetch_substr(self,dint:int):
|
|
208
|
+
assert is_number(dint,DEFAULT_PDD_EXCLUDED_OPERATING_NUMBER_TYPES)
|
|
209
|
+
|
|
210
|
+
add_ref = bool(dint % 2)
|
|
211
|
+
|
|
212
|
+
I = int(self.s)
|
|
213
|
+
I_ = None
|
|
214
|
+
if add_ref:
|
|
215
|
+
I_,self.cindex,_ = integer_derivation__type_PWO_selector_(\
|
|
216
|
+
I,self.cindex,self.rindex % len(self.s))
|
|
217
|
+
else:
|
|
218
|
+
I_,self.cindex,_ = integer_derivation__type_PWO_selector_(\
|
|
219
|
+
I,self.cindex,None)
|
|
220
|
+
self.rindex = self.rindex + 1
|
|
221
|
+
|
|
222
|
+
return I_
|
|
223
|
+
|
|
224
|
+
#--------------------------------- primary move: pairwise operation on two substrings of integerized float
|
|
225
|
+
|
|
226
|
+
def pairwise_op_with_skipped_selections(self,i):
|
|
227
|
+
skip_counts = modulo_in_range(i,DEFAULT_PDD_SELECTOR_SKIP_RANGE)
|
|
228
|
+
|
|
229
|
+
I = int(self.s)
|
|
230
|
+
pw_op = self.choose_pairwise_operator()
|
|
231
|
+
|
|
232
|
+
ref_index = self.rindex % len(self.s) if I % 2 else None
|
|
233
|
+
|
|
234
|
+
i2,self.cindex,ref_index = integer_derivation__type_PWO(\
|
|
235
|
+
I,pw_op,self.cindex,ref_index=ref_index,skip_counts=skip_counts)
|
|
236
|
+
|
|
237
|
+
if type(ref_index) != type(None):
|
|
238
|
+
self.rindex = ref_index
|
|
239
|
+
|
|
240
|
+
return i2
|
|
241
|
+
|
|
242
|
+
#--------------------------------- primary move: q pairwise operations with integer parameter and q elements from queue
|
|
243
|
+
|
|
244
|
+
def pairwise_ops_on_queue_elements(self,i):
|
|
245
|
+
x = modulo_in_range(i,DEFAULT_CACHE_OP_DRAW_SIZE_RANGE)
|
|
246
|
+
C = []
|
|
247
|
+
for _ in range(x):
|
|
248
|
+
d = self.deciding_int()
|
|
249
|
+
pw0 = self.choose_pairwise_operator()
|
|
250
|
+
C.append((d,pw0))
|
|
251
|
+
i2 = i
|
|
252
|
+
|
|
253
|
+
for x0,pw in C:
|
|
254
|
+
i2 = pw(i2,x0)
|
|
255
|
+
return i2
|
|
256
|
+
|
|
257
|
+
#------------------------------------- post-calculation of next float, updating queue
|
|
258
|
+
|
|
259
|
+
def update_queue(self):
|
|
260
|
+
q = -1
|
|
261
|
+
f2 = 0
|
|
262
|
+
while len(self.queue) > self.cache_size:
|
|
263
|
+
r = self.queue.pop(0)
|
|
264
|
+
|
|
265
|
+
if self.enable_base_delta:
|
|
266
|
+
# approach 1
|
|
267
|
+
f2 += modulo_in_range(r * q,DEFAULT_PDD_OPERATING_FLOAT_RANGE)
|
|
268
|
+
q = -1 * q
|
|
269
|
+
|
|
270
|
+
if self.enable_base_delta:
|
|
271
|
+
self.f = self.f + int(f2)
|
|
272
|
+
self.s = float_to_str__type_exclude_EDOT(self.f)
|
|
273
|
+
self.cindex = self.cindex % len(self.s)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
#--------------------------------- auxiliary methods for calculating the next float
|
|
278
|
+
|
|
279
|
+
def start(self):
|
|
280
|
+
q = int(self.s[-1])
|
|
281
|
+
|
|
282
|
+
if q % 2:
|
|
283
|
+
self.s = self.s[::-1]
|
|
284
|
+
|
|
285
|
+
add_ref = int(self.s[-1])
|
|
286
|
+
I = self.fetch_substr(add_ref)
|
|
287
|
+
self.queue.append(I)
|
|
288
|
+
|
|
289
|
+
return
|
|
290
|
+
|
|
291
|
+
def choose_act(self):
|
|
292
|
+
action = self.primary_move_list[self.rindex % len(self.primary_move_list)]
|
|
293
|
+
|
|
294
|
+
# shift move list by 1
|
|
295
|
+
Q = self.primary_move_list[1:]
|
|
296
|
+
self.primary_move_list = Q + [self.primary_move_list[0]]
|
|
297
|
+
return action
|
|
298
|
+
|
|
299
|
+
def deciding_int(self):
|
|
300
|
+
if len(self.queue) > 0:
|
|
301
|
+
i = self.rindex % len(self.queue)
|
|
302
|
+
return round(self.queue[i])
|
|
303
|
+
else:
|
|
304
|
+
self.start()
|
|
305
|
+
return self.deciding_int()
|
|
306
|
+
|
|
@@ -4,6 +4,7 @@ from morebs2.measures import zero_div,to_trinary_relation,to_trinary_relation_v2
|
|
|
4
4
|
from morebs2.numerical_generator import modulo_in_range,\
|
|
5
5
|
prg__LCG,euclidean_point_distance,prg_seqsort,prg__single_to_nvec
|
|
6
6
|
from types import MethodType,FunctionType
|
|
7
|
+
from operator import add,sub,mul,mod
|
|
7
8
|
from math import ceil
|
|
8
9
|
|
|
9
10
|
zero_div0 = lambda num,denum: zero_div(num,denum,0)
|
|
@@ -134,6 +135,9 @@ def safe_npint32__prg_vec(prg,sz):
|
|
|
134
135
|
v[i] = safe_npint32_value(prg())
|
|
135
136
|
return v
|
|
136
137
|
|
|
138
|
+
DEFAULT_PAIRWISE_OPS = [add,sub,mul,safe_div]
|
|
139
|
+
|
|
140
|
+
|
|
137
141
|
#------------------------ operations related to LCM and GCD
|
|
138
142
|
|
|
139
143
|
def lcm_times(x0,x1,m):
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
from types import MethodType,FunctionType
|
|
2
|
-
from operator import add,sub,mul,mod
|
|
3
|
-
from .extraneous import safe_div
|
|
4
2
|
from morebs2.numerical_generator import modulo_in_range
|
|
5
3
|
from morebs2.matrix_methods import is_valid_range
|
|
6
|
-
|
|
7
|
-
DEFAULT_PAIRWISE_OPS = [add,sub,mul,safe_div]
|
|
4
|
+
from .extraneous import DEFAULT_PAIRWISE_OPS
|
|
8
5
|
|
|
9
6
|
"""
|
|
10
7
|
for every pair of input integers (x1,x2), chooses
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{seqbuild-0.0.30 → seqbuild-0.0.32}/seqbuild/face/sample_script/seqbuild_realtime_command.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|