代码搜索结果
找到约 10,000 项符合
State Machine 的代码
state.cpp
/********************************************************************
created: 2006/08/05
filename: State.cpp
author: 李创
http://www.cppblog.com/converse/
purpose: State模式的
state.h
/********************************************************************
created: 2006/08/05
filename: State.h
author: 李创
http://www.cppblog.com/converse/
purpose: State模式的演示
state.h
class State //棋盘状态节点,一个State实例就是一个棋盘的状态节点,从而形成一颗树状结构
{
public:
int QP[4][4]; //当前棋盘数组
int e_fun; //评分结果
int child[9]; //当前棋盘状态下的后一步的所有状态节点
int parent; //当前棋盘状态下的父母节点下标
int bestChild;//
state.cpp
// state.cpp: implementation of the state class.
//
//////////////////////////////////////////////////////////////////////
#include "state.h"
//////////////////////////////////////////////////
state.m
function xdot = state(t,x); % returns the state derivatives
A = [0 1 0; 0 0 1; -6 -11 -6];
B=[1; 1; 1];
xdot = A*x'+ B*sin(2*pi*t);
%xdot = A*x';
state.c
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are