Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Optimization suggestion
#1
Hi everybody,
In this structure:
alpha is associated with beta, beta is the interruption time of alpha.
x =int(input())
for _ in range(x):
      n =int(input())
      for _ in range(n):
            alpha, beta =map(int, input().split())
What would be the most optimal method to test over a given time (x) for a number of users (n) the availability of alpha for future use?
Reply
#2
Can you provide more context please? I'm guessing the alpha, beta assignment is a placeholder for something that may take a long time to produce?

Is there any kind of sequential relationship in computing alphas where knowing information about a previous alpha makes it more efficient to compute the next alpha (like the Fibonacci example that is so popular).

Is there anything you could use as a key to reference previous results? Then you could use a dictionary to test if you had already computed an applicable alpha value.

If my questions sound silly it is because I'm unsure what it is you are asking.
Reply
#3
alpha is a production.
Several tasks are needed to produce it (alpha0, alpha1...) with different or identical execution times (1, 2, 3...). For example alpha0 can take 1 or n execution times.

Only one production machine is used, and different actors have to use this production machine.

The availability of the production machine must be defined and the usage requests must be recorded in order to identify the implementation of a possible sequential relationship.
There are never silly questions Wink
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can you give me some suggestion about PCEP Newbie1114 0 1,020 Oct-14-2021, 03:02 PM
Last Post: Newbie1114
  instagram followers name without suggestion for you jacklee26 1 3,168 Oct-02-2021, 04:57 AM
Last Post: ndc85430
  Need suggestion how to handle this error farrukh 1 2,266 Dec-21-2019, 03:21 PM
Last Post: DeaD_EyE
  first try with python class, suggestion for improvement please anna 18 5,937 Nov-01-2019, 11:16 AM
Last Post: anna
  [split] suggestion required for new script anna 1 2,967 Mar-27-2018, 06:42 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020