Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

INSTALLATION:

sudo -H pip3 install anytime

USAGE EXAMPLE:

"""

The following example program gets a very large vector

and tries to find the largest element in the vector.

It stops after a pre-specified time, and returns the largest element found so far.

"""



import random, numpy as np

from AnytimeAlgorithm2 import AnytimeAlgorithm



class MaximumFinder(AnytimeAlgorithm):

    def __init__(self, vector):

        self.vector = vector

        self.currentMaximum = 0



    def update(self):

        i = random.randint(0,len(self.vector)-1)

        if self.vector[i]>self.currentMaximum:

            self.currentMaximum = self.vector[i]

            print("self",self,"result",self.currentMaximum)



    def result(self):

        return self.currentMaximum



v = np.random.rand(10000000)

finder = MaximumFinder(v)

print(finder.result_after(0.0001))  # seconds

print(finder.result_after(0.001))  # seconds

print(finder.result_after(0.01)) # seconds

Keywords: anytime algorithms Platform: UNKNOWN Classifier: Development Status :: 2 - Pre-Alpha Classifier: Intended Audience :: Developers Classifier: Topic :: Software Development Classifier: License :: OSI Approved :: GNU General Public License (GPL) Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9

Metadata

Release files for anytime 1.0.0.dev2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anytime 1.0.0.dev2
File Size Uploaded Provenance Actions
anytime-1.0.0.dev2.tar.gz 17.3 kB Without provenance Details for anytime-1.0.0.dev2.tar.gz

Release files / anytime-1.0.0.dev2.tar.gz

Download URL anytime-1.0.0.dev2.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
78729b0f80d4c7f3eeefc9001753208ba043500c9f3880f4110651364f25378f
BLAKE2b-256 checksum
How to use checksums
d15a63bc58e729691e9b32c4a034ad451c320893623e8a305aba4da946c61e04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4

Security for anytime 1.0.0.dev2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page