Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78359807
series.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Aug 20, 03:16
Size
690 B
Mime Type
text/x-python
Expires
Thu, Aug 22, 03:16 (2 d)
Engine
blob
Format
Raw Data
Handle
20024619
Attached To
R7571 SP4E-TB-TL-FR
series.py
View Options
from
abc
import
ABC
,
abstractmethod
class
Series
(
ABC
):
def
__init__
(
self
):
self
.
current_term
=
0
self
.
current_value
=
0
def
__del__
(
self
):
pass
def
compute
(
self
,
N
):
if
self
.
current_term
<=
N
:
N
-=
self
.
current_term
else
:
self
.
current_value
=
0.
self
.
current_term
=
0
for
k
in
range
(
0
,
N
):
self
.
addTerm
()
return
self
.
current_value
@abstractmethod
def
getAnalyticPrediction
(
self
):
pass
def
addTerm
(
self
):
self
.
current_term
+=
1
self
.
current_value
+=
self
.
computeTerm
(
self
.
current_term
)
def
computeTerm
(
self
,
k
):
pass
Event Timeline
Log In to Comment