设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12704|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& n9 w' z. c) H: P2 T
1 I4 {2 a( U$ j! n" L我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 K1 z7 a8 S, x7 K% H2 h
3 q* r; e/ k1 }, t: b
begin P_read arriving
3 l  v2 r7 s; ~" N8 n9 A    while 1=1 do begin! k5 u0 m5 y: `& `1 J) s4 ^* P
        read A_tote from "data.txt" with delimiter "\n"
, p4 Z7 N$ i( y1 o9 e        read A_time from "data.txt" with delimiter "\n"- a1 |5 ?" f+ H% S
        read A_leave from "data.txt" with delimiter "\n"' n7 l) W. |% d' t' s  G9 r
        read A_picks from "data.txt" with delimiter "\n"9 z/ P6 V, {! ]8 c3 `) n5 J4 K" ]
        set load type to A_tote
0 R' a' m, s3 I. N0 ~1 h( A& q        if A_tote="tote 1" then set A_induct to 1
7 N: a4 Q+ H9 V2 I( R0 n        else if A_tote="tote 2" then set A_induct to 2
+ @+ e5 s  x3 T! Q            else set A_induct to 3   
0 C/ ?6 Z% h7 N7 R3 e; |* \2 Z        set A_i to 0
4 Q; F* j# X' V3 J0 {% M6 E$ J- o& M% g        clone 1 load to P_induction2 y4 ?5 k# o' x; n7 C
        wait for A_time sec
5 e( d8 f7 z, ?8 x    end1 z) l" k: r+ o
end
% r* y4 v  L# z& x6 P( |* E/ p# W1 f- b: n0 Y3 u" }
begin P_induction arriving: l( w4 j. Z) E0 A3 J1 b
    if A_induct=1 then clone 1 load to P_pick11 T1 z" S; d5 m) P4 i
    else if A_induct=2 then clone 1 load to P_pick2( z8 z1 r, B, g
        else clone 1 load to P_pick3, s1 V- {* }( c2 o. }# s6 M
end
9 C( Y4 _: `( h& `
4 s0 F% X2 q. j0 O. |begin P_pick1 arriving* ?5 O8 o% L) }. @5 I  z0 n
    set A_i to 1
7 k4 \1 A( @1 }3 Y) P4 N$ z    move into Q_induct1+ e2 z, K4 q5 j, @0 H, f% g
    move into pickaisle.induct1! T& w+ V/ Q% m3 n2 l
    while A_i<=30 do begin; C1 X0 J8 U& z4 B7 I  g0 _( N
        travel to pickaisle.con(A_i)
  Z, O( i7 C# I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 F' F# ~' [7 I1 ~" t& N: c
        else wait for 10 sec
' a. m- }0 d) u. p: n1 h* L        if A_i=A_leave then send to die/ c- b. k) t+ q. U; X2 Y! ^
        else inc A_i by 1
8 [0 }+ l3 ]+ @2 t( Z    end
; \5 a, h+ T8 P1 P6 x# p' send4 k; F9 E, o8 {. s5 M9 Z5 h

+ g( z2 Z9 x9 e. w, T& ^begin P_pick2 arriving
8 H. o9 j1 a5 ^0 ~    set A_i to 11% l9 P& @1 m  z; _& d
    move into Q_induct23 h/ @  M8 G# b) @6 P1 f3 @  p4 {
    move into pickaisle.induct2
) Z8 n  B9 |8 R. |: }5 x    while A_i<=30 do begin
% |! }, [! e: B1 R4 j: r+ k        travel to pickaisle.con(A_i)
/ Y" S3 \' D* ~" o# @        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( k3 |/ Q+ |! [# f" ]2 q        else wait for 10 sec2 o0 C4 B  u6 ~9 X, @
        if A_i=A_leave then send to die, b2 O6 o4 w2 k/ J8 a
        else inc A_i by 1: k' S- ?1 x+ z- R- [9 ]6 L
    end
' \+ Q) p0 _& ]" U% gend
. |8 Y* ?% B& C) |. I2 c
& S- K: ?% b' q' o& jbegin P_pick3 arriving
  g/ c2 l% k, A    set A_i to 212 `8 o4 e1 C  L3 z  ^% M: c8 i$ _
    move into Q_induct3
4 |( O* }+ L+ U7 j$ D. Y3 a* e    move into pickaisle.induct3
: Y% T6 e0 h1 a+ i. |    while A_i<=30 do begin
- i. ^- t# S4 ~1 M        travel to pickaisle.con(A_i)
  E6 n8 e8 @( v; [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 I# b$ T( Q: d( O2 B* X
        else wait for 10 sec, k4 b; n& Z( N# o% M! L0 Z' @
        if A_i=A_leave then send to die+ a* @! e6 K5 D7 z0 h8 [+ u; V/ n8 l
        else inc A_i by 1$ H* K/ E* |5 |
    end
! n. b" ^3 B6 f5 x5 \0 _2 l4 Eend

最佳答案

查看完整内容

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是个什么东东?
$ z0 O( z) U! c3 ~8 Lmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ D8 j' i5 o! D, `! }
# v9 B" x2 V% O9 a
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。9 J/ ^% f$ e7 ?  n3 w

& a& f4 Z2 }8 x另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
: v2 f. [3 P% b: p  k; _1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
. o8 ^' L' u" v0 W7 ^2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;/ |# F* ?# L' G+ O
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ o. t: l( ^) \* p6 Q
begin P_induction arriving
% n) i9 j* J4 }6 |9 t0 ?    clone 1 load to P_pick(A_induct)
1 Q. n+ Z8 I8 x6 V2 @- F. Cend最大的系
# v, x% }- D9 A& S
) V* j2 F! q3 |; p- M; O8 `. fbegin P_pick arriving3 Q' F8 e* ?7 T( o1 o' J- g
    set A_i to procindex * 10 + 1
' p, I$ h$ w: z0 c- B; w+ n    move into Q_induct(procindex)6 p; g' J: P  f0 S: C( {% Q
    move into pickaisle.induct(procindex)9 ]0 U' r) E& z6 R3 L( B
    /*check the type of pickaisle.induct(i), for your last problem.*/
6 k* e2 Z# Q$ ~: q
& W* H& n3 n8 I) m" a    while A_i<=30 do begin( ~! Y6 h$ l2 P9 J( Q2 z. o
        travel to pickaisle.con(A_i)
) |" B2 f: C) [: q$ e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 v! C' l# O% P. `        else wait for 10 sec
3 r; d+ K1 ]/ e' I0 p        if A_i=A_leave then send to die
9 b9 V# `6 q7 B        else inc A_i by 1
- x/ l1 \& n- E; {8 s    end
/ C( A' \& i, C& M2 s/ tend
+ ~+ \7 k- R* |! t/ b
  G5 d% O7 w; L* i% |4 [其中的procindex为整形,代表当前process的序号。
, u1 a' H6 d) r/ Z/ Q! Nstation和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-2-12 23:52 , Processed in 0.015417 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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