设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14074|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 t" y7 v: t! v& U* E1 Z$ K( H2 {9 J! b2 I+ H# v% K  K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 W. R4 v8 Q* T. |+ |+ }7 E1 g9 c" p* J, {; a6 H" F
begin P_read arriving
& B: \9 O4 ^" i    while 1=1 do begin
" I. M- }( ~' e, v7 }  I( Q        read A_tote from "data.txt" with delimiter "\n") t& J4 z; X4 R! H
        read A_time from "data.txt" with delimiter "\n"0 I  ~6 _" Z0 r, ~0 `0 T. B
        read A_leave from "data.txt" with delimiter "\n"% M7 c! D7 j9 m3 X) O4 ?" Z4 b
        read A_picks from "data.txt" with delimiter "\n"5 W$ }: t9 ]+ y
        set load type to A_tote% V2 P+ ]7 B3 I* n
        if A_tote="tote 1" then set A_induct to 1) t! `. P- G! F+ Y- x/ I  ?' ]
        else if A_tote="tote 2" then set A_induct to 2
$ p! F+ p0 z* n1 @1 [# m. q) P            else set A_induct to 3    $ x4 c/ ]& C7 ]) i( @# L
        set A_i to 0
- o) G- C7 ~; \& Z        clone 1 load to P_induction8 U- K' ]0 o" w- H4 l0 v  y5 N$ H
        wait for A_time sec
  F' |1 [0 E1 H/ M7 n    end7 {" c2 g# [+ n
end
! V; t9 y& N, P9 I/ h5 h5 t" ]/ v# g: J
begin P_induction arriving. B1 {% w: x$ u& K! o# O
    if A_induct=1 then clone 1 load to P_pick12 u2 H% G, ]9 ?$ v9 n
    else if A_induct=2 then clone 1 load to P_pick2
  w  D$ I3 _9 j2 J+ }' ]        else clone 1 load to P_pick34 i4 D8 l% N/ K5 F  W8 \. a
end2 {" `* f& B; x8 F2 W

2 E" v5 R$ K; @$ r' L8 O5 Xbegin P_pick1 arriving
( k- j; d% b7 C! \' p    set A_i to 1. ]( l6 A4 Q! H0 |! o5 H0 a
    move into Q_induct1
9 `5 e2 H$ h* k% i* r, `    move into pickaisle.induct1
0 x. l( X! t, [    while A_i<=30 do begin  E2 W: y* f- @& r
        travel to pickaisle.con(A_i)$ s7 G) l2 g  ]5 x$ F; Z/ b- g& W6 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' ~& f% g" |) A        else wait for 10 sec4 x: u: _* o4 Y9 ?4 M) V  @8 Q
        if A_i=A_leave then send to die0 M8 f5 h# h; l* e, O1 y8 {( I0 O, h
        else inc A_i by 1
( l) b+ ~& s8 Y) g( l    end
6 k3 B  D6 Y( {7 Wend
% b2 ]. @) b, i: l) B9 a
0 M9 ]& |" V! J" s. q0 sbegin P_pick2 arriving
9 y  n) o& H# k2 u7 [( x) P. ]1 F    set A_i to 11( k: Z) d& D7 p+ O, D. d  z. x" n
    move into Q_induct23 k8 W, g1 S. }) w9 H% e5 D
    move into pickaisle.induct2
, g- ~- h+ m3 [$ H    while A_i<=30 do begin* J7 o1 c8 J8 q/ S
        travel to pickaisle.con(A_i)& f3 R$ G+ l0 X2 x4 u  `8 ~; B
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# E) Y/ Y8 u7 u
        else wait for 10 sec. q" Y% M$ n1 d! N( o
        if A_i=A_leave then send to die; b; R5 Z" G0 i; y8 N
        else inc A_i by 1& u& D+ N' N- R! |
    end
4 V4 m/ W* \+ _: qend
4 P- N2 m2 m; I! x
7 ?; x( |9 S- L! g4 wbegin P_pick3 arriving
3 a7 V7 _' R+ E% f/ p( y2 Q    set A_i to 21
) \9 m  ^: S; Z% Z& Q9 H    move into Q_induct39 t' R+ T  U/ p
    move into pickaisle.induct3& h; g4 ~& G6 O: ^& K* ~
    while A_i<=30 do begin
1 {" ?% B  d& @4 ?$ _. }        travel to pickaisle.con(A_i)! T, v0 ]& o3 i9 A3 {8 A6 i/ Y- m
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ]% W' G0 M# Y4 b8 |
        else wait for 10 sec& h: [' Z( K4 R/ }, \& {& M
        if A_i=A_leave then send to die+ l- z" u# a5 d
        else inc A_i by 1
" F/ E. j+ R+ K4 ?    end
7 g! U7 _9 N; `; d: m8 ?! q" i1 \2 Vend

最佳答案

查看完整内容

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是个什么东东?
+ C. W. _# L8 a, X6 f9 y0 Bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
9 v/ c0 ^- @% r5 b6 q! _# A
5 O# x) j9 J& p+ c0 _- WAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。" g0 B7 P2 [0 I
3 d& b6 v; ?- g3 u
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:4 q7 t, V; c* T+ W% _# q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
) }9 p5 e8 A9 n9 S: d1 {+ c2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
. s  `, A0 e% ^$ o3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
4 v- `0 m8 E  \begin P_induction arriving
& ]4 ?, a* K* G' S7 g" S" [    clone 1 load to P_pick(A_induct): g6 h" F6 g% O) m$ H2 b
end最大的系; Q/ [3 S6 j4 D$ L% ^/ G

' q" Q. ?* B# j9 Z" E! }begin P_pick arriving: E" x+ S3 \/ `7 X
    set A_i to procindex * 10 + 15 v% C5 Z7 t* J
    move into Q_induct(procindex)
; U8 I; @: _; h8 @4 U    move into pickaisle.induct(procindex)
) f. z5 [3 A' M: F  J4 I  G    /*check the type of pickaisle.induct(i), for your last problem.*/
' H: J8 L- J# C" T2 @% g$ W
5 U& ?  r- {& |* Y/ ?8 L    while A_i<=30 do begin. Y; X! W9 k1 r" c9 v* y( |0 Y* ~
        travel to pickaisle.con(A_i)
7 a( ]$ h# M& C4 n        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( ~2 T  \: n- [  t. F7 F8 `        else wait for 10 sec
9 Q# f. y: J% Y  ]8 b$ v) ?        if A_i=A_leave then send to die
" h! v/ A5 g6 P' b3 {, @, d        else inc A_i by 16 ^" Z& O. b& h
    end7 m! Y. b$ ~0 v4 f5 S
end
) \+ j/ R' h7 d# H' ^
* x6 D6 {5 h" @# N; p其中的procindex为整形,代表当前process的序号。
6 y9 U4 ~+ i  ^3 R5 Mstation和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-6-6 02:47 , Processed in 0.012305 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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