Пример #1
0
def main():
    model = VelocityModel(
        regressionModel=joblib.load('models/gradient-m.model'), frequency=10.0)
    agent = RLAgent('agent',
                    decisionFrequency=20.0,
                    defaultSpeed=4,
                    defaultAltitude=6,
                    yawRate=60,
                    alternativeModel=model,
                    maxDepth=math.inf,
                    initialState=None)

    agent.setRl(verifyModel)
    agent.start()
    agent.join()
Пример #2
0
def main():
    agent = RLAgent('agent',
                    decisionFrequency=10.0,
                    defaultSpeed=4,
                    defaultAltitude=6,
                    yawRate=60)

    agent.defineState(orientation=getOrientation,
                      position=getPosition,
                      angularVelocity=getAngularVelocity,
                      linearVelocity=getVelocity,
                      linearAcceleration=getLinearAcceleration,
                      angularAcceleration=getAngularAcceleration)

    agent.setRl(partial(flightLogger, dataset='datasets/' + 'replay.csv'))
    agent.start()
    agent.join()
Пример #3
0
def main():
    agent = RLAgent('agent',
                    decisionFrequency=10.0,
                    defaultSpeed=4,
                    defaultAltitude=20,
                    yawRate=70)

    # callbacks will be called in the order they were specified, beware of order of execution (if any state parameter is
    #  dependant on another)
    # state is lazily updated by the environment as the agent needs it , agent always get the freshest estimate of the
    # state, state updates are done by the environment in a rate that corresponds to agent decision making freq.

    agent.defineState(orientation=getOrientation,
                      angularVelocity=getAngularVelocity,
                      linearVelocity=getVelocity,
                      position=getPosition)

    agent.setRl(monteCarlo)
    agent.setReward(reward)
    agent.setGoal(position=np.array([-40, -50, 0]))
    agent.setGoalMargins(position=np.array([0.5, 0.5, math.inf]))
    agent.start()
    agent.join()