设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12638|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* b4 D5 D: }! S0 ?! U# F2 e

7 X' g0 N4 J# w3 r) d我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ s, i/ |, ]! Z7 q& i2 `1 Q" c7 k. j
begin P_read arriving" @( G0 C1 M, s( v
    while 1=1 do begin8 J" {+ p& I# i! ~) X6 A/ b! r
        read A_tote from "data.txt" with delimiter "\n"9 v. K. M8 x' n1 |* ]3 k# r- R
        read A_time from "data.txt" with delimiter "\n"; G/ e- b2 V6 D
        read A_leave from "data.txt" with delimiter "\n"' w6 m3 f5 G  {* P3 {
        read A_picks from "data.txt" with delimiter "\n"
/ T( p) }- e6 J% ]0 }        set load type to A_tote; A2 J0 w0 y; S0 \* F' x
        if A_tote="tote 1" then set A_induct to 1
4 B  O7 d1 j: f# J: A, f        else if A_tote="tote 2" then set A_induct to 2
8 [+ {& w. K8 J/ y            else set A_induct to 3   
$ X3 w6 ]: T1 _/ G: \( h7 u0 G        set A_i to 03 M: V4 ?5 u' t8 k; f$ |
        clone 1 load to P_induction" V8 J% [0 m: z4 P
        wait for A_time sec
: {8 X  z0 W$ y' R8 x/ f7 S5 T    end* m& p+ `. c" r1 l4 X  Y! N7 S
end
$ g6 V! i) J' |" r0 K7 G' j! M, v' T+ \: N
begin P_induction arriving4 S& a% Z7 Y0 \6 j3 U" w
    if A_induct=1 then clone 1 load to P_pick1. @' B9 a3 v6 I' e
    else if A_induct=2 then clone 1 load to P_pick2
" h9 `$ w8 @6 i$ o) J8 u. G        else clone 1 load to P_pick3
- ~4 z8 U: ]9 R! |. Jend
. j) [# y5 L' s/ @
) G- Y( b+ L% i7 o' y/ ebegin P_pick1 arriving+ f2 [/ ?* Z9 C
    set A_i to 1
8 Q! t% G. W# r    move into Q_induct1& M. V/ C& P4 C( y+ o) C  z
    move into pickaisle.induct1( Z# Y4 f0 g; }/ z9 k/ H3 |
    while A_i<=30 do begin
% n) a; p# S' U3 m        travel to pickaisle.con(A_i)
* {  E! T+ n3 y! x" i        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 l: k$ u5 ]0 R  n" ^) L8 O
        else wait for 10 sec
' g$ W% O5 s7 y( o        if A_i=A_leave then send to die
3 i& V( r  Y1 k' M. F% n        else inc A_i by 1
5 {0 s1 A. M" {7 a3 `    end
# a/ k' ~) ]7 Q6 eend
, y1 T$ I# I6 Y* [* v: t/ k6 N6 j% W6 h9 ~& h9 t
begin P_pick2 arriving
/ ~$ G9 X: y! e9 Z    set A_i to 11) {$ |; n/ k3 c2 \! c) _3 N
    move into Q_induct2% o" _, u- R% ]9 }- ]6 e! z& x2 r! V: _
    move into pickaisle.induct20 ]2 f! q: V% X+ {# p
    while A_i<=30 do begin2 o1 }7 ?( J- S7 c' R8 Z3 }
        travel to pickaisle.con(A_i)
7 m  i2 w( v. x* S, e        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% u; q* z. {- V
        else wait for 10 sec5 c. a: o2 a' N
        if A_i=A_leave then send to die6 Q6 s6 `4 G; [" a
        else inc A_i by 15 `9 R$ }! h; X4 k9 x
    end. c2 D% K0 `9 V
end
7 M, d) r7 a  L2 K7 ^7 a5 V. Z( s+ @: Z; U. \
begin P_pick3 arriving: ^1 T7 v& T, y: r. F
    set A_i to 21# ~+ r% y, ?/ z1 w
    move into Q_induct3
9 @5 R+ e" k8 _9 H0 P    move into pickaisle.induct3
* y1 u8 I3 v' G0 x    while A_i<=30 do begin
0 V) u( a* d; r1 r, l% a        travel to pickaisle.con(A_i)# t# s( C/ S) ~% v6 N. `1 E! U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: w. N. P& \8 M, D; z# t        else wait for 10 sec
% @! H% {$ l' V        if A_i=A_leave then send to die) V" j2 N6 o# Q* S  o
        else inc A_i by 1& ?' {- @5 w4 L2 V
    end/ t8 m. j$ f$ B2 ]: ^' t  U( l
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是个什么东东?% \% g: G' i0 W! ?0 [
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" A4 D* H) d" R  y8 q) r+ |; f; y6 l# k7 L& g
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。1 M: w+ n5 c$ F0 n+ B

- m% @5 A* a( I# ~另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:& b# {8 T" K* l4 [" U9 p7 z! h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;" F" v6 V9 S+ G# S% r9 S+ p
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- v! Y$ z: X! G/ K* \6 G/ h3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, T: B  }, }7 b0 D4 n9 P* b
begin P_induction arriving
( M* z. B4 r  X: t+ m  N    clone 1 load to P_pick(A_induct)
0 j  ~( f6 o8 R+ W5 uend最大的系
, R; X* v5 n( a
0 t& k0 w8 ^1 n* b$ Qbegin P_pick arriving; c" b* }3 T6 k0 J7 T. F1 y/ Q; c
    set A_i to procindex * 10 + 1
/ S! t9 s: ]8 |+ i7 n: r    move into Q_induct(procindex)& |2 Z7 x- e6 B# p
    move into pickaisle.induct(procindex)$ M+ v% m4 W; i/ O  a$ a9 D2 ~5 a
    /*check the type of pickaisle.induct(i), for your last problem.*/
) T8 @  Q  b- b5 k9 F: b$ I. v+ N/ N4 D8 @5 }# Y# I# L+ `
    while A_i<=30 do begin1 x3 T" D2 x4 b; u
        travel to pickaisle.con(A_i), w7 m: Q4 B! L5 Q4 [
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ J2 U! g& i- b( r+ [7 M
        else wait for 10 sec7 q  N$ Y3 W4 T5 W/ @; b1 b: j  W
        if A_i=A_leave then send to die1 \1 u1 v, X( q8 e! y  V( X
        else inc A_i by 16 ~$ e" B' e3 ]0 m2 Z
    end% m( t  d+ F6 C- E  m3 c
end& ~6 }0 L( b' A% ]  M
" K' m: i. K. z
其中的procindex为整形,代表当前process的序号。" y- n" D- C- ]" z! V5 R: ?$ A. j
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-2-6 19:34 , Processed in 0.017083 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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