示例#1
0
# Main
def main():
	# Build the window
	window.init()
	
	# Get the window
	current_window = window.get()
	
	# Apply the icons
	window.icons(current_window)

# Launch
if __name__ == '__main__':
	# Create the workflow
	main()
	
	# Load settings
	settings.init()
	
	# Build the menu
	menu.init()
	
	# Start events
	events.start()
	
	# Enables PNG alpha support
	glEnable(GL_BLEND)
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
	
	# Run app!
	pyglet.app.run()
示例#2
0
# main.py
import src.settings as settings
import src.submodule as submodule

settings.init()  # Call only once
submodule.stuff()  # Do stuff with global var
print(settings.myList[0])  # Check the result
import math
import numpy as np

from src import settings
from src.gridworld import evaluate, improve, update_value_greedy, get_policy_from_state_value_function
from src.plot import plotv, plotpi

settings.init()  # set num_observations global variable

gamma = 0.90
theta = math.pow(10, -5)

possible_actions = [1, 2, 3, 4]

states = np.array([i for i in range(0, 25)])

# initial state values: all zeros
V = np.zeros(25)

while True:
    old_V = np.copy(V)
    for s in states:
        v = V[s]
        V[s] = update_value_greedy(s, possible_actions, old_V, gamma)

    # return true if every element in V and old_V are closer than THETA
    # to each other.
    if np.allclose(old_V, V, rtol=0, atol=theta):
        break

policy = get_policy_from_state_value_function(V, possible_actions, gamma)
import math
import numpy as np

from src import settings
from src.gridworld import evaluate,improve,update_value_greedy,get_policy_from_state_value_function
from src.plot import plotv,plotpi

settings.init() # set num_observations global variable

gamma = 0.90
theta = math.pow(10,-5)

possible_actions = [1,2,3,4]

states = np.array([i for i in range(0,25)])

# initial state values: all zeros
V = np.zeros(25)

while True:
    old_V = np.copy(V)
    for s in states:
        v = V[s]
        V[s] = update_value_greedy(s,possible_actions,old_V,gamma)

    # return true if every element in V and old_V are closer than THETA
    # to each other.    
    if np.allclose(old_V,V,rtol=0,atol=theta):
        break

policy = get_policy_from_state_value_function(V,possible_actions,gamma)
示例#5
0
import copy
import math
import random

import src.TileLogic as TL
import src.settings as sett
import src.character_sprite as character_sprite
import src.character as Char
import src.pathfinder as pf

pygame.init()
pygame.mixer.init()



sett.init()

def logic_tile_init():
    logic_tiles = []
    for i in range(sett.nb_tiles_h):
        logic_tiles.append([])
        for j in range(sett.nb_tiles_w):
            logic_tiles[i].append(TL.TileLogic((i, j)))
    prev_cursor_pos = [0, 0]
    cursor_pos = [0, 0]
    logic_tiles[cursor_pos[0]][cursor_pos[1]].is_cursor = True

    for i in range(int(sett.nb_tiles_h*sett.nb_tiles_w*0.5)):
        rh = random.randint(0, sett.nb_tiles_h-1)
        rw = random.randint(0, sett.nb_tiles_w-1)
        logic_tiles[rh][rw].cost += 1
示例#6
0
programGui.start_app()

program_version = '3.2'
'''
if isUpToDate('./README.MD', "https://raw.githubusercontent.com/Eugenio-Pozzobon/Formula-UFSM-Data-Analysis/master/README.MD") == False:
   if programGui.get_update_preference():
       update('./README.MD', "https://raw.githubusercontent.com/Eugenio-Pozzobon/Formula-UFSM-Data-Analysis/master/README.MD")

'''

# enable RAM cleaner
gc.enable()

# get program settings
settings.init()

# check if user has license
if lic.checkLicense():

    # get user mode selection
    # run
    if programGui.getuserselection() == 'wcu':
        wcuScreen.runwcu()
    if programGui.getuserselection() == 'ncu':
        ncuOpenLOGfile.parseLogFile()
    if programGui.getuserselection() == 'log':
        ncuOpenReport.startNCU()  # file selection and descompression
        ncuOpenReport.runLogAnalysis()  # file analysis

else: