设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12528|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 z5 W# j& j) K
/ i4 b2 F1 z- d. G我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 N  `1 n7 N# E" u

* w0 D( H9 `3 L8 Z7 p+ B: Sbegin P_read arriving: \( b  D( J# E. X
    while 1=1 do begin6 R1 q5 s" [6 ?; }' o$ I7 d1 h1 n. M
        read A_tote from "data.txt" with delimiter "\n"
$ U6 U- `0 [- V& B  C9 T        read A_time from "data.txt" with delimiter "\n"
3 O4 |1 ]2 L6 A& w9 U        read A_leave from "data.txt" with delimiter "\n"  _, o, b0 M% I5 {
        read A_picks from "data.txt" with delimiter "\n"! O* V9 U5 Z- I% ?
        set load type to A_tote0 e0 @$ h' ?- t0 [: J3 ~: m% B
        if A_tote="tote 1" then set A_induct to 1
. s) X6 C' _& D; {2 k        else if A_tote="tote 2" then set A_induct to 2
( h- Z+ l+ f3 @            else set A_induct to 3   
1 d1 Y& D2 n; i& r4 F' S        set A_i to 03 `* f8 D& i; }+ v0 \
        clone 1 load to P_induction9 c9 `& ]4 \: E' D# j9 a$ g
        wait for A_time sec, ^/ Y3 ?  L3 d, T4 ?# W1 j
    end
8 A& b  z( V7 T- _' ~- {1 send3 a& e- q) O( }0 Z% h- G% W
; y& C  e) j# X& {
begin P_induction arriving# X' S' |; K2 H
    if A_induct=1 then clone 1 load to P_pick1/ ]) _4 C* P) C4 h/ K( C2 c
    else if A_induct=2 then clone 1 load to P_pick2
9 F9 l4 L+ O3 H        else clone 1 load to P_pick3- T5 c9 x% t8 M! }- g5 h% Z+ G
end
+ ~9 i0 ?. u# G0 {3 o. r$ G  x3 B3 k8 A- j1 e
begin P_pick1 arriving) g# ]. P7 c' w4 ?0 l. N0 R
    set A_i to 1
. K; H  d: v% D5 g    move into Q_induct1
! F" D' R/ r' q& T8 d2 `    move into pickaisle.induct1$ U% ~' Y2 N1 r% Y4 [$ [
    while A_i<=30 do begin
5 _6 l/ L5 G/ }! d& u+ g. {        travel to pickaisle.con(A_i)% r' \- W/ x2 `) ~- R; j
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 `/ c: }  ~* z/ _$ y  p5 I        else wait for 10 sec
  W+ |+ C9 P0 F5 M" q. {0 P2 X% @        if A_i=A_leave then send to die
' M2 k& R' c' O        else inc A_i by 1$ ?$ h5 |2 r+ r; n5 H! Z
    end: b4 i2 L* D- I) ]
end
, x! E& y) y5 G3 l+ P
' A3 \) {0 x) ybegin P_pick2 arriving
0 Q& J7 s5 L: m3 ]/ w$ h    set A_i to 116 ~" w. a! f9 `4 e
    move into Q_induct2$ h) o. \2 s. g% {# X, K
    move into pickaisle.induct2) M. B3 Q' I8 t$ w) Z" F& ~
    while A_i<=30 do begin3 G5 F) w& T: ?0 Q, w
        travel to pickaisle.con(A_i)
5 h+ y0 T4 c, @, Q4 {" V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! \1 I/ ]5 f6 \4 o4 T& \        else wait for 10 sec
9 @  {& B2 l& e3 C        if A_i=A_leave then send to die* v7 q: u) i1 n( y3 Q( q* s# T2 [
        else inc A_i by 1
! }2 x( `; y7 W. `- H    end$ ]) b5 `+ K/ n" b! t# o8 N
end
. M9 l% l, n; ~5 b3 D4 J
: i- ?1 O9 P# G" ^6 e7 Y& |3 sbegin P_pick3 arriving
+ Y$ O8 f$ X( z* Z! u7 U4 k1 R    set A_i to 21. x# n! m0 A. }5 l
    move into Q_induct32 t( B& g# W1 @0 \4 U: p: ~" I
    move into pickaisle.induct3
+ x2 H1 \( ]9 _/ ?& b/ @    while A_i<=30 do begin
9 A$ y' `8 H+ C        travel to pickaisle.con(A_i)# W# P6 K% D+ Y* f
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ c! r; ]/ g+ P4 _1 z1 P( D
        else wait for 10 sec2 m% M8 c0 q, R* r; f9 L9 g+ h4 Z
        if A_i=A_leave then send to die
1 n0 u+ y* W1 A        else inc A_i by 1
( U! T! S' v/ i2 k6 i: Z    end
2 Z8 S$ ]( L( B) i3 {% jend

最佳答案

查看完整内容

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是个什么东东?
8 I& G0 n/ `6 F- [move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 S. L5 o2 `9 e8 s; @9 e
6 m6 s, x3 v  x. G$ [$ rAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
2 Z8 P# w2 h% i& E, H
0 M7 J7 u" |8 O7 N$ g" h: L另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:; Y: A3 J8 y5 V( U% ^( s
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 q3 G6 j( U4 J: s- a$ n: Z2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;+ Z2 b) t& I; X  V+ @6 v& ?- C
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
# u/ X0 j. I' e5 {3 ]6 ^begin P_induction arriving7 w* q; @! u& @. `' a" l
    clone 1 load to P_pick(A_induct)# z5 r) E( Y5 Z) {
end最大的系( e3 G# P7 `$ z! T( g- ~: p

4 \" O- s0 h$ R9 R4 c& Ybegin P_pick arriving
9 @1 ?* \4 A" b+ i0 p$ P) ]    set A_i to procindex * 10 + 15 }# r: |/ W4 z* l9 p$ E
    move into Q_induct(procindex)
5 v) P! R5 X  P6 v. B( b2 e" @    move into pickaisle.induct(procindex)4 L( R! r+ S$ B) s) I- T$ {3 V0 i
    /*check the type of pickaisle.induct(i), for your last problem.*/
8 R7 {4 n* T% m) ^6 K$ N
# _4 ?, p; [$ l    while A_i<=30 do begin4 n1 J- S" \9 f$ Y7 j5 _8 p  x
        travel to pickaisle.con(A_i)5 w1 p, {" \5 p+ ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ y9 e; i% @7 Y7 M" s1 r  T
        else wait for 10 sec# m* f5 [( Y# n- A
        if A_i=A_leave then send to die2 @/ v# D+ p' p
        else inc A_i by 1
- E1 v; p: C; \' U    end
+ b6 l: U$ f6 d0 G" Send
* h5 v* L5 Z9 h3 v) b0 l
; k4 o0 |4 j# k' W其中的procindex为整形,代表当前process的序号。/ I0 S# @* p) J7 \# o2 Q: i0 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-1-30 06:09 , Processed in 0.015679 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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