ダウンロード
Magazine
開発
アカウント
ダウンロード
Magazine
開発
ログイン
アカウント/パスワードを忘れた
アカウント作成
言語
ヘルプ
言語
ヘルプ
×
ログイン
ログイン名
パスワード
×
アカウント/パスワードを忘れた
日本語の翻訳状況
カテゴリ:
ソフトウェア
人物
PersonalForge
Magazine
Wiki
検索
OSDN
>
ソフトウェアを探す
>
科学/工学
>
人工知能
>
RoboCup tools
>
フォーラム
>
ヘルプ
>
VoronoiDiagram point compute probleam ?
RoboCup tools
概要
プロジェクト概要
開発ダッシュボード
Webページ
開発メンバー
画像ギャラリー
公開フィード一覧
活動
統計情報
活動履歴
ダウンロード
リリース一覧
統計
ソースコード
コードリポジトリリスト
CVS
リポジトリ閲覧
チケット
チケット一覧
マイルストーン一覧
チケットの種類一覧
コンポーネント一覧
よく使われるチケット一覧のリスト/RSS
新規チケット登録
コミュニケーション
フォーラム
フォーラム一覧
ヘルプ (55)
メーリングリスト
MLの一覧
ニュース
フォーラム:
ヘルプ
(スレッド #37324)
話題(スレッド)一覧に戻る
RSS
VoronoiDiagram point compute probleam ? (2015-11-29 19:49 by
Deng Yong
#77269)
返信
チケットに引用
In agent2D3.1.1 , I use base Interface too compute VoronoiDiagram point,
for exeample
:{
VoronoiDiagram M_pass_voronoi_diagram;
const Rect2D rect = Rect2D::from_center( 0.0, 0.0,
ServerParam::i().pitchLength() - 10.0,
ServerParam::i().pitchWidth() - 10.0 );
M_pass_voronoi_diagram.clear();
const SideID our = wm.ourSide();
const AbstractPlayerCont::const_iterator end = wm.allPlayers().end();
for ( AbstractPlayerCont::const_iterator p = wm.allPlayers().begin();
p != end;
++p )
{
if ( (*p)->side()!=wm.ourSide())
{
M_pass_voronoi_diagram.addPoint( (*p)->pos() );
}
}
// our goal
M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5, 0.0 ) );
// M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5,
// - ServerParam::i().goalHalfWidth() ) );
// M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5,
// + ServerParam::i().goalHalfWidth() ) );
// opponent side corners
M_pass_voronoi_diagram.addPoint( Vector2D( + ServerParam::i().pitchHalfLength() + 10.0,
- ServerParam::i().pitchHalfWidth() - 10.0 ) );
M_pass_voronoi_diagram.addPoint( Vector2D( + ServerParam::i().pitchHalfLength() + 10.0,
+ ServerParam::i().pitchHalfWidth() + 10.0 ) );
M_pass_voronoi_diagram.setBoundingRect( rect );
#if 0
// our goal
M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5, 0.0 ) );
// M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5,
// - ServerParam::i().goalHalfWidth() ) );
// M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5,
// + ServerParam::i().goalHalfWidth() ) );
// opponent side corners
M_pass_voronoi_diagram.addPoint( Vector2D( + ServerParam::i().pitchHalfLength() + 10.0,
- ServerParam::i().pitchHalfWidth() - 10.0 ) );
M_pass_voronoi_diagram.addPoint( Vector2D( + ServerParam::i().pitchHalfLength() + 10.0,
+ ServerParam::i().pitchHalfWidth() + 10.0 ) );
M_pass_voronoi_diagram.setBoundingRect( rect );
#endif
M_pass_voronoi_diagram.compute();
std::vector<Vector2D> *target_map=new std::vector<Vector2D>;
// M_pass_voronoi_diagram.getPointsOnSegments(3,3,target_map);;
double best_eva=0;
Vector2D best_point=target_point;
// std::cout<<(*target_map).size()<<std::endl;
VoronoiDiagram::Vector2DCont VN_Point;
VN_Point=M_pass_voronoi_diagram.resultPoints();
std::ofstream fout("vorongraph.txt",std::ios::app);
for (VoronoiDiagram::Vector2DCont ::const_iterator it =VN_Point.begin(); it!=VN_Point.end(); it++)
{
fout<<"clycle"<<wm.time().cycle()<<"*******"<<(*it)<<std::endl;
if ( (*it).absX()>52||(*it).absY()>33)
{
continue;
}
target_map->push_back((*it));
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
but I find the point diffrent with soccerwindow2 _voronoi_diagram point?
It 's a bug in agent2d3.1.1?
メッセージ #77269 への返信
×
題名
本文
メッセージ #77269 への返信 > In agent2D3.1.1 , I use base Interface too compute VoronoiDiagram point, > for exeample > :{ > VoronoiDiagram M_pass_voronoi_diagram; > > const Rect2D rect = Rect2D::from_center( 0.0, 0.0, > ServerParam::i().pitchLength() - 10.0, > ServerParam::i().pitchWidth() - 10.0 ); > > > M_pass_voronoi_diagram.clear(); > > const SideID our = wm.ourSide(); > > > const AbstractPlayerCont::const_iterator end = wm.allPlayers().end(); > for ( AbstractPlayerCont::const_iterator p = wm.allPlayers().begin(); > p != end; > ++p ) > { > > if ( (*p)->side()!=wm.ourSide()) > { > M_pass_voronoi_diagram.addPoint( (*p)->pos() ); > } > > } > // our goal > M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5, 0.0 ) ); > // M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5, > // - ServerParam::i().goalHalfWidth() ) ); > // M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5, > // + ServerParam::i().goalHalfWidth() ) ); > > // opponent side corners > M_pass_voronoi_diagram.addPoint( Vector2D( + ServerParam::i().pitchHalfLength() + 10.0, > - ServerParam::i().pitchHalfWidth() - 10.0 ) ); > M_pass_voronoi_diagram.addPoint( Vector2D( + ServerParam::i().pitchHalfLength() + 10.0, > + ServerParam::i().pitchHalfWidth() + 10.0 ) ); > > M_pass_voronoi_diagram.setBoundingRect( rect ); > > > #if 0 > // our goal > M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5, 0.0 ) ); > // M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5, > // - ServerParam::i().goalHalfWidth() ) ); > // M_pass_voronoi_diagram.addPoint( Vector2D( - ServerParam::i().pitchHalfLength() + 5.5, > // + ServerParam::i().goalHalfWidth() ) ); > > // opponent side corners > M_pass_voronoi_diagram.addPoint( Vector2D( + ServerParam::i().pitchHalfLength() + 10.0, > - ServerParam::i().pitchHalfWidth() - 10.0 ) ); > M_pass_voronoi_diagram.addPoint( Vector2D( + ServerParam::i().pitchHalfLength() + 10.0, > + ServerParam::i().pitchHalfWidth() + 10.0 ) ); > > M_pass_voronoi_diagram.setBoundingRect( rect ); > #endif > > M_pass_voronoi_diagram.compute(); > > > std::vector<Vector2D> *target_map=new std::vector<Vector2D>; > // M_pass_voronoi_diagram.getPointsOnSegments(3,3,target_map);; > double best_eva=0; > Vector2D best_point=target_point; > // std::cout<<(*target_map).size()<<std::endl; > > VoronoiDiagram::Vector2DCont VN_Point; > VN_Point=M_pass_voronoi_diagram.resultPoints(); > std::ofstream fout("vorongraph.txt",std::ios::app); > > for (VoronoiDiagram::Vector2DCont ::const_iterator it =VN_Point.begin(); it!=VN_Point.end(); it++) > { > > fout<<"clycle"<<wm.time().cycle()<<"*******"<<(*it)<<std::endl; > > if ( (*it).absX()>52||(*it).absY()>33) > { > continue; > } > > target_map->push_back((*it)); > > } > //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// > } > > but I find the point diffrent with soccerwindow2 _voronoi_diagram point? > It 's a bug in agent2d3.1.1?
Wiki文法は使えません
ログインしていません。投稿を区別するために投稿者のニックネームをつけてください(ニックネームの一意性は保証されません。全く別の人も同じ名前を利用することが可能ですので本人であることの特定には利用できません。本人であることを保証したい場合にはログインして投稿を行なってください)。
ログインする
ニックネーム
プレビュー
投稿
キャンセル