设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12445|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 [- Q; @6 o2 `. v. W

' `" z# m" I; U% p6 x/ j我的问题是,在每个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中的数值,不知道会不会有什么不妥。( Y, V* P- V% M! ^8 E
, {# Q& W% y8 x( y$ Z
begin P_read arriving
8 T( x& K. I* T    while 1=1 do begin
* o, ^3 x6 F9 R        read A_tote from "data.txt" with delimiter "\n"/ S- T; R$ X+ b6 Q7 R: y
        read A_time from "data.txt" with delimiter "\n": C$ \; v4 j3 [8 d( f
        read A_leave from "data.txt" with delimiter "\n"
; |* U! Q/ h8 n3 k6 I8 V2 e. r        read A_picks from "data.txt" with delimiter "\n"
' H3 p0 O2 T- Z% m! m        set load type to A_tote
$ d0 S) {4 h4 ?. K! H& i        if A_tote="tote 1" then set A_induct to 1
% Y7 k8 _- l1 M+ K9 z" f        else if A_tote="tote 2" then set A_induct to 2( S- i4 O/ G7 a" o2 I4 d
            else set A_induct to 3   
2 L" Z( r6 ?7 m! L" e6 @        set A_i to 0" C0 c+ h+ }8 T
        clone 1 load to P_induction
  Q0 f2 {4 @& B' K/ a1 L/ i/ z        wait for A_time sec
2 `* C+ G! [7 P- g/ _" E; s    end
1 C4 L' t/ P1 ~end: z* o/ Z/ ^/ R

1 a, A6 j8 T8 }* X. {begin P_induction arriving
! h) |! R/ b; \8 \. K    if A_induct=1 then clone 1 load to P_pick1% r3 _6 x- R" |0 u( k
    else if A_induct=2 then clone 1 load to P_pick2
0 h$ ?) G- u8 X- O8 J9 z9 l        else clone 1 load to P_pick3
5 r: e9 n% ~; }, ~" @7 rend- E; _! U; U1 U5 u

, W. c* z7 f4 Tbegin P_pick1 arriving
) _8 t2 k% P, J  I% E. l5 K- W    set A_i to 1
' a& l" }6 S) ~" J5 L    move into Q_induct15 W) ^3 n' ?% L5 V/ n
    move into pickaisle.induct1
/ T! `9 E4 K; ^7 |4 |; Q    while A_i<=30 do begin
# N- H( o+ U3 p5 ~        travel to pickaisle.con(A_i)/ B+ r& n: {; O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) A. {0 m$ k. d2 t
        else wait for 10 sec
( }' _/ t3 G2 y" Q# p% n        if A_i=A_leave then send to die
+ N. T4 }- y7 p1 z5 H        else inc A_i by 1
6 J0 c; t- t  g, m) y3 R    end
! o, H/ s+ x5 W- z1 v0 gend
& j% H5 h9 o: r* x) H3 n) q5 o3 f. _# t9 ?% l% o% x/ f! i* j
begin P_pick2 arriving
* N. v0 W( o5 x5 |    set A_i to 11
% {) Y8 r& U* {: E/ `; W3 n- x    move into Q_induct2# b$ x8 t6 n2 `) P% ^
    move into pickaisle.induct2/ Q' g. O& ^. f5 {& ?2 s
    while A_i<=30 do begin
9 s' R$ J4 w- s0 {! S        travel to pickaisle.con(A_i)
/ c" o& H$ J3 d/ N* P4 \' Z% M1 P        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* P. d. h+ a$ v- Q7 D4 E+ i
        else wait for 10 sec
3 j9 x/ F. N$ v% p; m        if A_i=A_leave then send to die& G$ G: ~! F- G5 ]( d
        else inc A_i by 1+ A7 D6 P0 g1 B* B4 F) m
    end
# s  _. P2 h/ k+ Rend" P) {1 C. |% m

6 v* ~  G+ S: ~begin P_pick3 arriving  U# J8 v6 l& W+ Q
    set A_i to 21
" V; N0 A) M& K' s    move into Q_induct3
6 m% p8 \2 J7 i- D7 L5 ^) _    move into pickaisle.induct3
) V& s9 ~3 w& U7 |% C  a    while A_i<=30 do begin
$ R1 s) x& o! w+ S        travel to pickaisle.con(A_i)" J  V, M5 O) |' L: e0 |
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, G/ }. a6 l% A; q) M
        else wait for 10 sec/ T0 D7 l; w7 C" {; G
        if A_i=A_leave then send to die
/ e# m! M/ L3 E6 t        else inc A_i by 19 M* l, t: i6 g7 \+ O
    end4 D8 ^" \- Y1 ]7 w* ^. e9 S. b
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是个什么东东?
5 E$ q, I& {7 V1 i) \" O$ d- Dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?$ F' W# f* \; }8 {3 d; Y/ U; s
2 Y& w6 L/ a* s9 @) W/ s8 u
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
$ W% m+ r' s, j$ \! r% j$ n" j/ `
4 t, [7 x' |! z# I* p另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:5 O& j3 ~* n3 b1 Z2 D1 s! [) e; J
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! e" o; r( [8 A: x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 h0 m: d* g1 Z0 ]. s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% s/ H* ^& ]' q( S7 xbegin P_induction arriving
0 h/ V: Z. E# `* k* {4 j1 p    clone 1 load to P_pick(A_induct)
1 b, W4 X: O" a& E" ]6 oend最大的系& {" p3 p, m" w4 P' C1 g% z
: R! H) h  z4 f! P" i: G
begin P_pick arriving8 v0 E  P, c' C
    set A_i to procindex * 10 + 19 z( s( J1 H6 X' L# V/ H
    move into Q_induct(procindex)
! \& z; O8 v9 l    move into pickaisle.induct(procindex): G1 t. U: u+ v5 j% `/ V& u$ M
    /*check the type of pickaisle.induct(i), for your last problem.*/
4 h8 L: ~& ]1 I* G
/ I8 W9 j7 D3 {. X    while A_i<=30 do begin: i; N, N7 P$ g7 y' I5 y9 W) y
        travel to pickaisle.con(A_i), {& {+ n" V' q! I- S  n; G; ~+ g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: D5 @2 P. t* F5 j- d
        else wait for 10 sec6 T% @5 D/ t: Q6 m  B! S0 J
        if A_i=A_leave then send to die; M% M* s4 x4 I* J) h, ]( {' i5 T
        else inc A_i by 1* h! [4 ]( G: S, z; W5 c
    end5 B+ E8 }* P6 P' e1 T, A
end7 V4 W2 S% r2 c7 c. A. r3 \$ N
  R) i2 `2 v& a7 _  S
其中的procindex为整形,代表当前process的序号。: t7 ^8 [5 ?0 r# v1 N6 P3 S
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-24 06:24 , Processed in 0.017384 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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