Re: [robocup-rescue-s] Help on Kernel problems or My codes

From: Cameron Skinner <cam@cs.auckland.ac.nz>
Date: Tue 18 Apr 2006 - 02:31:57 GMT

Tomoichi Takahashi wrote:
> 2. Table 2. in a case of multi properties, encoding format seems
> followings :) In entrance property in building obejct KobeMap,
> "1" is set in the 3rd field. Am I right?
>
> \begin{table}[p]
> \center
> \begin{tabular}{|l|l|l|}
> \hline
> Field & Data type & Meaning\\
> \hline
> Header & int & Property type\\
> Length & int & Size of property data in bytes\\
> Value & int & Property value\\
> \hline
> \multicolumn{3}{l}{in a case of multi properties}\\
> \hline
> Field & Data type & Meaning\\
> \hline
> Header & int & Property type\\
> Length & int & Size of property data in bytes\\
> Value & int & Number of property values\\
> Value & int & Property value$_{1}$\\
> & : & \\
> Value & int & Property value$_{n}$\\
> \hline
> \end{tabular}
>
> \caption{Property encoding format}
> \label{table_property_format}
> \end{table}
>

Hi.

Yes, that is correct. For the entrance property the number of values is
*usually* 1, but it might be something else. Your code should be able to
handle both cases.

Pseudocode for reading both kinds of property type is as follows:

if (property is int) {
  return readIntValue();
}
if (property is int array) {
  int size = readIntValue();
  int[] data = new int[size];
  for (int i=0;i<size;++i) data[i] = readIntValue(i);
  return data;
}

I hope that helps.

Cheers,
Cameron.

-- 
Cameron Skinner
Artificial Intelligence Group
Department of Computer Science
The University of Auckland
email: cam@cs.auckland.ac.nz
phone: +64 9 3737599 x82924
fax: +64 9 3737453
Post:
Department of Computer Science
The University of Auckland
Private Bag 92019
Auckland
New Zealand
_______________________________________________
robocup-rescue-s mailing list
robocup-rescue-s@mailman.cc.gatech.edu
https://mailman.cc.gatech.edu/mailman/listinfo/robocup-rescue-s
Received on Tue Apr 18 04:48:04 2006

This archive was generated by hypermail 2.1.8 : Tue 18 Apr 2006 - 02:48:05 GMT