annotate Paper/riono-sigos.tex @ 13:8336f55a92e7

update chapter MessagePack
author riono <e165729@ie.u-ryukyu.ac.jp>
date Tue, 04 May 2021 18:35:43 +0900
parents ca30f2e91c45
children 73a3c53c7568
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 %%
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 %% 研究報告用スイッチ
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 %% [techrep]
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 %%
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 %% 欧文表記無しのスイッチ(etitle,eabstractは任意)
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 %% [noauthor]
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 %%
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 %\documentclass[submit,techrep]{ipsj}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 \documentclass[submit,techrep,noauthor]{ipsj}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 \usepackage[dvips]{graphicx}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 \usepackage{latexsym}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 \usepackage{url}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 \usepackage{listings}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 \usepackage{caption}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 \def\Underline{\setbox0\hbox\bgroup\let\\\endUnderline}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 \def\endUnderline{\vphantom{y}\egroup\smash{\underline{\box0}}\\}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 \def\|{\verb|}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 %
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 %\setcounter{巻数}{59}%vol59=2018
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 %\setcounter{号数}{10}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 %\setcounter{page}{1}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
8
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
29 \lstset{
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
30 language=java,
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
31 tabsize=2,
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
32 numbers=left,
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
33 frame=single,
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
34 basicstyle={\ttfamily\footnotesize}, %
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
35 identifierstyle={\footnotesize}, %
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
36 commentstyle={\footnotesize\itshape}, %
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
37 keywordstyle={\footnotesize\bfseries}, %
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
38 ndkeywordstyle={\footnotesize}, %
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
39 stringstyle={\footnotesize\ttfamily},
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
40 breaklines=true,
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
41 captionpos=t,
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
42 columns=[l]{fullflexible}, %
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
43 xrightmargin=0zw, %
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
44 xleftmargin=1zw, %
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
45 aboveskip=1zw,
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
46 numberstyle={\scriptsize}, %
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
47 stepnumber=1,
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
48 numbersep=0.5zw, %
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
49 lineskip=-0.5ex,
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
50 }
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
51
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
52 \renewcommand{\lstlistingname}{Code}
5
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 \begin{document}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 \title{継続を使用する並列分散フレームワークのUnity実装}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 %\etitle{How to Prepare Your Paper for IPSJ SIG Technical Report \\ (version 2018/10/29)}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 \affiliate{KIE}{琉球大学大学院理工学研究科情報工学専攻}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 \affiliate{IE}{琉球大学工学部工学科知能情報コース}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 \author{安田 亮}{Ryo Yasuda}{KIE}[riono210@cr.ie.u-ryukyu.ac.jp]
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 \author{河野 真治}{Shinji Kono}{IE}[kono@ie.u-ryukyu.ac.jp]
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 \begin{abstract}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 FPSやMMORPGなどのゲームにおける通信方式には、クライアントサーバ方式とp2p方式の2つが考えられる。しかし、クライアントの負荷軽減やチート対策などを理由にクライアントサーバ方式が主流である。データの同期にはサーバを経由するため低速である。
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 そこで本研究室で開発している分散フレームワークChristieを用いることで、高速かつ、安全に、データの同期を行いたいと考えた。
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 本研究ではChrisiteをゲームエンジンUnityに対応するため、C\#への書き換えを行う。
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 \end{abstract}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 %
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 %\begin{jkeyword}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 %情報処理学会論文誌ジャーナル,\LaTeX,スタイルファイル,べからず集
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 %\end{jkeyword}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 %
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 %\begin{eabstract}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 %This document is a guide to prepare a draft for submitting to IPSJ
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 %Journal, and the final camera-ready manuscript of a paper to appear in
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 %IPSJ Journal, using {\LaTeX} and special style files. Since this
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 %document itself is produced with the style files, it will help you to
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 %refer its source file which is distributed with the style files.
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 %\end{eabstract}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 %
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 %\begin{ekeyword}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 %IPSJ Journal, \LaTeX, style files, ``Dos and Dont's'' list
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 %\end{ekeyword}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 \maketitle
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 \section{オンラインゲームにおけるデータ通信}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 \section{Christieの基礎概念}
7
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
98 Chrisiteは当研究室で開発している分散通信フレームワークである。同じく当研究室で開発している GearsOSのファイルシステムに組み込まれる予定があるため、GearsOSを構成する言語 Continuation based Cと似た概念を持っている。 Chrisiteに存在する概念として以下のようなものがある。
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
99
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
100 \begin{itemize} %箇条書き
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
101 \item CodeGear
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
102 \item DataGear
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
103 \item CodeGearManager
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
104 \item DataGearManager
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
105 \end{itemize}
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
106
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
107 以下はjava版のChrisiteについて解説を行う。
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
108 CodeGearはクラスやスレッドに相当する。
8
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
109 DataGearは変数データに相当し、CodeGear内でannotationを用いて変数データを取得する。CodeGear内に記述した全てのDataGearの中にデータが格納された際に、初めてそのCodeGearが実行されるという仕組みになっている。
7
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
110 CodeGearManagerはノードであり、CodeGear、DataGear、DataGearManagerを管理する。
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
111 DataGearManagerはDataGearを管理するものであり、putという操作により変数データ、つまりDataGearを格納できる。DataGearManagerのput操作を行う際にはLocalとRemoteのどちらかを選び、変数のkeyとデータを引数として渡す。
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
112 Localであれば、LocalのCodeGearManagerが管理しているDataGearManagerに対しDataGearを格納していく。Remoteであれば、接続したRemote先のCodeGearManagerが管理しているDataGearManagerにDataGearを格納できる。
8
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
113 put操作を行った後は、対象のDataGearManagerの中にqueueとして保管される。DataGearを取り出す際には、CodeGearm内で宣言した変数データにannotationをつける。DataGearのannotationにはTake、Peek、TakeFrom、PeekFromの4つがある。
7
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
114
65d3256f35d1 update chapter Christie
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 5
diff changeset
115
8
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
116 \begin{description}
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
117 \item[Take] 先頭のDataGear を読み込み、そのDataGear を削除する。DataGearが複数ある場合、この動作を用いる
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
118 \item[Peek] 先頭のDataGear を読み込むが、DataGear が削除されない。そのため、特に操作をしない場合は同じデータを参照し続ける。
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
119 \item[TakeFrom (Remote DGM name)] Take と似ているが、Remote DGM nameを指定することで、その接続先(Remote) のDataGearManager からTake 操作を行える。
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
120 \item[PeekFrom (Remote DGM name)] Peek と似ているが、Remote DGM name を指定することで、その接続先(Remote) のDataGearManager からPeek 操作を行える。
9
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
121 \end{description}
8
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
122
9
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
123 \section{プログラムの例}
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
124 Code \ref{code:javaSHW} はChrisite の機能を使用してhello world を出力する例題である。
10
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
125 CodeGearManager を作り、setup(new CodeGear) を行うことで各CodeGear に記述されたDataGear の待ち合わせを行う。全てのDataGear が揃った場合にCodeGear が実行される。CodeGearaManager の作成方法はStartCodeGear を継承したものから、createCGM(port) を実行することにより、CodeGearManager が作成できる。
9
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
126
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
127
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
128 \lstinputlisting[caption=StartHelloWorld, label=code:javaSHW]{src/StartHelloWorld.java}
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
129
5
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 \section{Unity}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132
8
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
133 \section{annotation の書き換え}
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
134 java 版ではDataGear を取得する際に、annotation という java の機能を用いて行った。C\#には annotation はなく、代わりにattribute を利用して DataGear の取得を行っている。
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
135 以下のCode \ref{code:javaTake}、Code \ref{code:csTake}はjava とC\# におけるTakeの実装である。
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
136
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
137 \lstinputlisting[caption=java における Take annotation, label=code:javaTake]{src/Take.java}
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
138
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
139 \lstinputlisting[caption=C\# における Take attribute, label=code:csTake]{src/Take.cs}
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
140
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
141 java でannotation を自作する際には、 @interfacs で宣言する。また、Code \ref{code:javaTake} の8行目ではannotation情報をどの段階まで保持するかを指定しており、Take の場合 JVMによって保存され、ランタイム環境で使用できる。9行目ではannotationの適用可能箇所を指定しており、フィールド変数に対して適応可能となっている。
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
142
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
143 C\# でattribute を作成する際には、 System.Attributeを継承する必要がある。attribute の適用可能箇所については、Code \ref{code:csTake} の4行目でフィールド変数を指定している。
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
144
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
145 \section{MessagePackの相違点}
10
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
146 Christie ではデータを送信する際に、MessagePack を使用してデータを圧縮し、送信している。java 版で使用しているMessagePack はバージョンが古く現在はサポートされてない。そのためMessagePack の最新版とは記述方法が異なっている。Code \ref{code:mspackEx} はMessagePack の使用方法を示したものである。
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
147
12
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
148 \lstinputlisting[caption=java 版におけるMessagePack の使用方法, label=code:javamspackEx]{src/MessagePackEx.java}
10
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
149
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
150 MessagePack を使用するには圧縮するクラスに対して @Message annotationをつける必要がある。これにより、クラス内で定義したpublic変数が圧縮される。
12
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
151 Code \ref{code:javamspackEx} の17 - 21行目は圧縮解凍の例であり、MessagePackのインスタンスを作成後、msgpack.write(data) を行うことでbyte[] 型にdataを圧縮できる。
10
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
152 解凍にはmsgpack.read を使用し、圧縮されたbyte[] 型と圧縮対象のクラスを渡すことで解凍できる。
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
153
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
154
13
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
155 C\# のMessagePack は複数存在しており、java と同様な書き方をするMessagePack-CSharp を選択した。
10
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
156
12
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
157 \lstinputlisting[caption=C\# 版におけるMessagePack の使用方法, label=code:csmspackEx]{src/MessagePackEx.cs}
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
158
13
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
159 MessagePack-CSharp ではjava 版と同様にクラスに対して圧縮を行うためCode \ref{code:csmspackEx} の1行目で MessagePackObject attribute を追加している。また、圧縮する変数に対してkey を設定することができ、int やstring を指定することができる。
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
160
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
161
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
162 データの圧縮にはMessagePackSerializer.Serialize (data) を使用し、byte[] 型に圧縮される。解凍にはMessagePackSerializer.Deserialize$<T>$(data) を使用する。Deserializeはジェネリスク関数であるため、$<>$内に解凍するデータのクラスを指定する。
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
163 Code \ref{code:csmspackEx} の21行目では、変数それぞれにkey を設定していることでjson に展開することが可能である。
12
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
164
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
165
13
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
166
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
167
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
168
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
169
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
170
8336f55a92e7 update chapter MessagePack
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 12
diff changeset
171
12
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 10
diff changeset
172 \section{CodeGear 実行時のThreadPool からTask への変更}
9
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
173
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
174
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
175
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
176 \section{C\#への書き換え後のプログラムの例}
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
177
10
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
178 \lstinputlisting[caption=C\# StartHelloWorld, label=code:csSHW]{src/StartHelloWorld.cs}
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
179
78129eaf8770 update chapter MessagePack java
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 9
diff changeset
180
9
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
181 \section{Unityでの動作}
8
48c1f1d9fc65 add src and update chapter attribute vs annotation
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 7
diff changeset
182
5
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
183
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 \section{チート対策について}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
185
9
c5abec609e35 add StartHelloWorld
riono <e165729@ie.u-ryukyu.ac.jp>
parents: 8
diff changeset
186 \section{実装の現状}
5
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
187
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
188
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 \nocite{*}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 \bibliographystyle{ipsjunsrt}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 \bibliography{riono-sigos}
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
192
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
193
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
194
74259b2a6dfa Organize folders
riono <e165729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 \end{document}