14.02.2013 Views

A Graphical Petri Nets Simulator - Rochester Institute of Technology

A Graphical Petri Nets Simulator - Rochester Institute of Technology

A Graphical Petri Nets Simulator - Rochester Institute of Technology

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.3. Data Structure Format <strong>of</strong> Driver and Net-editor<br />

The following<br />

formats that are used in the project.<br />

structure type MAP_T<br />

unsigned short *map;<br />

int short x,<br />

short y;<br />

int pixel x,<br />

pixel y:<br />

are descriptions <strong>of</strong> some important data structure<br />

/* point to a bitmap memory */<br />

/* the # <strong>of</strong>unsigned short <strong>of</strong>width */<br />

/* the # <strong>of</strong>unsigned short <strong>of</strong>height */<br />

/* pixel # <strong>of</strong>width */<br />

/* pixel # <strong>of</strong>heigh */<br />

map is a pointer that points to the address <strong>of</strong> the first short <strong>of</strong> an arbitrary size<br />

array <strong>of</strong>shorts. This array is used to save the pattern <strong>of</strong> a rectangular bitmap.<br />

Short x and short y specify<br />

the rectangle's width and height in shorts.<br />

Pixel x and pixel y specify the rectangle's width and height in pixels.<br />

structure type RECT_T<br />

int<br />

left,<br />

up,<br />

right,<br />

bottom;<br />

/* the x coordinator <strong>of</strong>upper-left corner */<br />

/* the y coordinator <strong>of</strong>upper-left corner */<br />

/* the x coordinator <strong>of</strong>right-bottom corner */<br />

/* the y coordinator <strong>of</strong>right-bottom corner */<br />

This data structure specifies a rectangle region by<br />

two points the<br />

upper-left corner and the right-bottom corner <strong>of</strong> the rectangle. It is used to<br />

specify<br />

boundary<br />

the size <strong>of</strong> rectangular bitmaps and the exact position and the<br />

box <strong>of</strong> icons.<br />

ture type SEG_ T<br />

int type;<br />

int id;<br />

int token;<br />

int cap;<br />

char *text;<br />

struct SEG_P<br />

RECT_T * bbox;<br />

* from,<br />

*to;<br />

/*<br />

specify the icon type */<br />

/* the identify # <strong>of</strong> entry */<br />

/* token # / probability wt. / wt. */<br />

/*<br />

capacity<br />

<strong>of</strong>the place */<br />

/* text string or name <strong>of</strong>the entry */<br />

/* the input icon <strong>of</strong>the arc */<br />

/* the output icon <strong>of</strong>the arc */<br />

/* the boundry box <strong>of</strong>the icon */<br />

27-

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!