# This function chooses at random which action to be performed within the range # of all the available actions. def ActionChoice(available_actions_range): if(sum(PossibleAction)>0): next_action = int(ql.random.choice(PossibleAction,1)) if(sum(PossibleAction)<=0): next_action = int(ql.random.choice(5,1)) return next_action # Sample next action to be performed action = ActionChoice(PossibleAction)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter