设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14882|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ w+ e) @( ]) w) j
# i: D0 K) Y, D: Y我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。# P3 t. Z$ j3 h: k' ~9 V  _

* t* i$ s1 l7 L" B; X, Jbegin P_read arriving
% q" G0 |" F- m5 {    while 1=1 do begin# Z, W- _" h5 Y- _' S: k
        read A_tote from "data.txt" with delimiter "\n"% D3 l$ T# X) e" W+ m
        read A_time from "data.txt" with delimiter "\n"! V" G! ~3 H& C% W7 F
        read A_leave from "data.txt" with delimiter "\n"
& o) u  R6 g* e! c9 M: H  d        read A_picks from "data.txt" with delimiter "\n"6 x) b7 m; J. U, c7 L2 B9 r. }
        set load type to A_tote
3 d% a+ U( S. U: m( n$ Y! M        if A_tote="tote 1" then set A_induct to 1# D, N8 ]) C- X0 _
        else if A_tote="tote 2" then set A_induct to 21 h' @& }/ n# q
            else set A_induct to 3   
6 n( N3 u! I0 k, n% S! d8 q        set A_i to 0# e% M* S" O3 E5 K3 g
        clone 1 load to P_induction
- X+ t* J# B2 R( N9 L        wait for A_time sec
) J' j) D: |" [% P    end
* @" d* a; |2 Pend
+ }# p# M- @/ h9 C5 D  ]: L7 f4 S  }
% n; a' c3 X0 I" ~8 V* D) N0 Y  fbegin P_induction arriving
& q% p  I, r* J) N4 D7 R    if A_induct=1 then clone 1 load to P_pick1; M7 N% }- Q( d3 p: d- a2 j' x, L  b
    else if A_induct=2 then clone 1 load to P_pick2
+ {/ @; {0 f4 w8 i' @) l2 w3 k# Q        else clone 1 load to P_pick3! k6 P% }# m5 W$ W" u+ h" W
end
! {4 B2 z$ ]4 b$ w& @  }  q  t4 k( H3 Q( e7 e
begin P_pick1 arriving
7 V+ P  c1 h4 i, I9 n  ^) Z    set A_i to 1
; G4 s* B$ f. Y* Q8 k6 o    move into Q_induct1; n; G* {8 `4 P, s; S
    move into pickaisle.induct1
* P. I# F% z" \/ g" Z    while A_i<=30 do begin2 Q' F! D1 _4 S$ d
        travel to pickaisle.con(A_i)$ |. H# \$ M8 o8 r
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, x' Z3 u' U' Q" R7 f% M) i        else wait for 10 sec
) g" [! d$ w5 x        if A_i=A_leave then send to die
3 a+ B& k% g6 T" w- y        else inc A_i by 1
2 y0 T7 O8 o+ o* X8 B1 M+ s    end
6 f# n2 f. x" F) s) J9 G& W* Dend
% E/ ?3 p  R; J( J* [3 Y7 y8 B9 k1 m/ z* u
begin P_pick2 arriving
- Y1 V* f( _3 I5 N7 `/ s! s    set A_i to 11
* [2 ^9 ?# g1 t9 G! L& ]    move into Q_induct2
, v; I4 r& j4 ]    move into pickaisle.induct2) ]' o" n( R# h) ?# ~
    while A_i<=30 do begin& ~# ^& t* t: g; x
        travel to pickaisle.con(A_i)% o1 |3 @$ G7 B" X; L) F7 M- z' \+ L, C
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 ?- }6 K# i; l. a        else wait for 10 sec
( y% y; K9 B( s' Y$ @3 d' o. B        if A_i=A_leave then send to die* A: s( p& t1 M- R' m4 E. `
        else inc A_i by 1
$ {1 Y- f6 s' J    end1 O9 n2 Q# r- D7 T8 N8 @( o& @
end# y) i5 \" H% Y

7 a. V  l  h/ H0 c. _$ i% C" ?begin P_pick3 arriving
; k; O4 I) R: c# b    set A_i to 21
5 w/ I; x  i  t- b8 F0 [    move into Q_induct3
* _$ f* r: Q# X6 T" Y4 `    move into pickaisle.induct3
0 U: y9 K7 L7 B1 f- R    while A_i<=30 do begin; L3 E3 U9 x* Z1 c
        travel to pickaisle.con(A_i)
) Q9 I: h0 A$ \0 n: G# z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( h9 z7 X3 F: h. z' J# Z  h! u7 @: I        else wait for 10 sec. ~% x( E7 v, H* L
        if A_i=A_leave then send to die
$ i6 Z0 K6 J) {8 j" ~; J0 D: g* w        else inc A_i by 19 i( Z& Z- V. I/ H7 c
    end$ N  J$ d: c: @$ }8 o$ b4 C
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
$ p3 r& _9 }  W! S4 E7 q' zmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
- h$ Y3 A( m  }* Y$ t6 }+ |
5 g1 V6 c4 l3 S, g$ pAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& K' r) X: [3 h- ?6 U. j" p; z2 K8 b0 b7 i! o- Y, C& w' z) ]
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:. A6 K8 k( o! u: }$ l
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
4 H4 v6 k  T$ g: k2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
& v3 q4 n( G0 _1 r" n5 T3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! i9 L3 \! `5 e( Z( A, h" Gbegin P_induction arriving) X0 [. W+ P4 s1 r$ {( ~! _
    clone 1 load to P_pick(A_induct)
2 i; ~8 H/ ?, z' o- Kend最大的系. n4 i. D3 i( ~3 O1 M
  b9 a+ d: {9 N% ~7 k0 J$ W( M
begin P_pick arriving
, Z. k6 d( t8 M    set A_i to procindex * 10 + 1
% X0 V  I- e$ E7 V    move into Q_induct(procindex)& l, b9 p- t3 z. Z3 W3 q
    move into pickaisle.induct(procindex)! l3 `  b# \+ V( P* c
    /*check the type of pickaisle.induct(i), for your last problem.*/6 I; z! P0 r6 G2 J7 Y9 X
4 \$ K8 U9 u* e2 A
    while A_i<=30 do begin
& ]& P' T! U! L" k% Z4 G1 E/ P        travel to pickaisle.con(A_i)' V0 f# q9 |) S: s3 Q! k2 b$ z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 D' E$ W9 C8 D( ]$ {3 {% B2 k
        else wait for 10 sec$ p! E4 q0 Y* ~. s
        if A_i=A_leave then send to die
+ R* G& v! L( k7 P# f7 R8 [* W        else inc A_i by 1
, Y5 s* g/ F0 L" q! T    end
! c* ]4 u7 Y' d$ x4 \, k0 cend+ s2 R" I1 V! i9 t# K- @# h
6 y! ?, s( V1 L
其中的procindex为整形,代表当前process的序号。2 d; E" v% J1 g+ v
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2026-7-29 17:12 , Processed in 0.016744 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表