设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12921|回复: 2

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

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

5 ]. K( n% V! h  u( y7 m我的问题是,在每个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 m0 L, @( _2 C4 @  t2 N
' G) x9 \5 S0 P: h. ubegin P_read arriving
7 R; b4 {5 [5 e  a& d. z    while 1=1 do begin3 ^& c7 P% n; s, b
        read A_tote from "data.txt" with delimiter "\n"
8 a  {5 I$ p0 g, C3 f+ p4 t1 }        read A_time from "data.txt" with delimiter "\n"
: M$ I" v, F! O) A' Y2 S        read A_leave from "data.txt" with delimiter "\n"
: B4 e; E" P" q        read A_picks from "data.txt" with delimiter "\n"/ X2 x* q5 M# Q
        set load type to A_tote% N' _9 y5 B) J6 S1 S
        if A_tote="tote 1" then set A_induct to 1
2 |% q5 h' m; z/ `        else if A_tote="tote 2" then set A_induct to 2
- x; W9 f0 f: M, b            else set A_induct to 3    , U; z* e' _- O3 J9 [3 U. B3 M
        set A_i to 0
/ [0 L/ j# A! w0 Z5 X. s, J6 w        clone 1 load to P_induction
9 s/ v2 S: W* |* b/ X        wait for A_time sec* C5 g* _) B! D% z! n8 E% k6 k
    end
4 L  r: r0 r5 Tend5 v' D( t/ ?% ^1 ^* Y8 m+ x: I& H2 i

: x% K$ \! \' c. }- f+ w3 pbegin P_induction arriving5 [7 o' ]% a! E6 X  H0 j- N
    if A_induct=1 then clone 1 load to P_pick1& @' w5 S  j5 d' n' ~0 Q
    else if A_induct=2 then clone 1 load to P_pick29 t$ {* e. A' c. ~4 b0 N
        else clone 1 load to P_pick31 a4 a8 o* f  `4 U) ]. D7 c
end
6 c+ O$ o( V, x; ]7 H& W) N4 j) h9 B" G
begin P_pick1 arriving
  S  Q$ _; y' e2 j! ^" M8 Q' ]    set A_i to 1/ d9 Q+ p+ E2 f: h. h: v! ]# c
    move into Q_induct1
6 ^) M; c* X8 k/ ~) G; H    move into pickaisle.induct1
9 s% ?: ^: D4 X  U    while A_i<=30 do begin5 D0 B# n$ B8 \* X+ f) Y
        travel to pickaisle.con(A_i)+ Y& |6 M' R) Y. V. Y# `6 H7 I
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 ?- ?: S# S0 A% b5 F3 p        else wait for 10 sec
, C" d: A  V3 W' f        if A_i=A_leave then send to die
5 C- P' N$ K7 z8 n        else inc A_i by 1
$ W* U* l( M2 |4 l! `7 f  k    end
+ I9 Q- C; @$ B, g5 Q  nend2 a6 ]; j7 U9 ~4 D

! ]0 K; E# F# z/ W4 E8 H/ [! obegin P_pick2 arriving7 X6 ~0 e3 D3 N7 _
    set A_i to 11
6 R& S/ z6 A' y" a    move into Q_induct2
+ A/ m! h# U' p) G0 p    move into pickaisle.induct2
4 V6 F; |2 }: B4 c1 @( F( K- k* \7 i    while A_i<=30 do begin7 s% o! A/ s. n: N6 {( b" f
        travel to pickaisle.con(A_i)
* u8 e" Z- Z" \        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ?. L1 Y7 a# r9 g: t/ V% k. z( \
        else wait for 10 sec
9 t( x$ |( g) j& q3 H! Z        if A_i=A_leave then send to die6 V6 I8 @) J  u
        else inc A_i by 11 w7 y: N2 J$ e4 w5 B8 C* _
    end) y8 ~/ u9 S7 c# a* A, X% n# ?8 c
end
% e3 H9 m* j5 n* ^7 @/ b
0 c1 U) b/ B6 S& @3 f4 ^% bbegin P_pick3 arriving
$ g3 F; `( M& }: z    set A_i to 21
) w4 ~2 [3 |1 j6 ?4 C* |& N" d6 f    move into Q_induct3
/ |4 q% l# S7 ?+ f# R    move into pickaisle.induct3$ X% F  b2 o, a( ~$ J
    while A_i<=30 do begin
* ]* n; j% x( e& t( D- E* X. \        travel to pickaisle.con(A_i), |# c/ w, r  }! I( S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" `0 \0 v0 }4 Y; L: r: p2 M        else wait for 10 sec
) k% w5 i$ W) d* I4 ]        if A_i=A_leave then send to die
* c" C1 V9 R9 l5 M/ Z        else inc A_i by 1, v( x2 ?! F: \9 Y# B  E$ f
    end) N) G" r  l5 D/ {0 Z
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 p3 L; F* e7 J/ Y  A) d; `
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?, s# p5 \) r' U: q1 v( s2 X
+ _. b, f5 U2 i) K/ P. S0 G& z
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
/ {: J' @+ C( g7 C
8 e8 v( ]0 B4 g' z' y5 a9 [另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
. T7 f" e0 S7 A  P$ X, y" P) G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;- |' o, F& P+ P7 P
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
, K4 i  U1 S6 ?, H3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 k9 q; i- G4 l! L4 sbegin P_induction arriving
4 q* t, y" C  }" _    clone 1 load to P_pick(A_induct)
8 Z% K2 F8 [- _4 U' e2 N6 H  x# Fend最大的系
# P' [) @, A' w) z: ]% v( ]$ Z8 J+ R7 N5 l& J- W) U
begin P_pick arriving
7 Q& Q, ~1 l3 o& d; p* W    set A_i to procindex * 10 + 1
* e: G6 [" l: b    move into Q_induct(procindex)
/ L7 Z! Z0 U  h0 e( G' v    move into pickaisle.induct(procindex)* S! C( m  x1 D$ A) D; i" t  t
    /*check the type of pickaisle.induct(i), for your last problem.*/
# z: r. A6 r! }2 v: ~2 l2 F4 ~: t% K- D( O# A" Z
    while A_i<=30 do begin$ B& z3 P" Q# z; p% K0 m0 ?0 e
        travel to pickaisle.con(A_i)+ `! H+ I& S) C1 Q0 E  X: s
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( b& E4 A2 h( @9 U& T* Z5 b        else wait for 10 sec4 p) ~3 q2 `. L6 j5 @6 o6 u6 G. s( N
        if A_i=A_leave then send to die
8 r: i" w, ~* K7 k  f6 ~+ _        else inc A_i by 1) K# Q& E2 `3 l8 J
    end& e# F3 ~- Y6 y" `6 d0 O
end
1 e* r1 l, \) V% N, o. E/ B/ ^2 c; w) C* J
其中的procindex为整形,代表当前process的序号。# T% M: \9 L5 K3 |  T
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-3-2 18:36 , Processed in 0.017174 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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