设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 9625|回复: 2

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

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

/ f& r, X3 P! e& a# \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ E! _! W6 X* V
% @: {& ^2 @% t  Obegin P_read arriving
, R. K8 L$ H9 t2 s    while 1=1 do begin
! i% L" \. D- P        read A_tote from "data.txt" with delimiter "\n"
! n  v1 t8 U0 a2 L  z: r        read A_time from "data.txt" with delimiter "\n"
, t! `( Y8 D* z3 @6 e        read A_leave from "data.txt" with delimiter "\n"
  b( q; i% n5 t0 f& _$ b        read A_picks from "data.txt" with delimiter "\n"  p$ H( r' O- i4 x4 l, ?, M
        set load type to A_tote
4 U& K. r3 x+ F! v0 H! k+ e        if A_tote="tote 1" then set A_induct to 14 s, s9 I: ?) o# F9 h1 I, O
        else if A_tote="tote 2" then set A_induct to 2
! h" ]9 V+ a& B0 @/ P3 w% V            else set A_induct to 3   
2 N+ |2 t* g5 y' [$ _' X1 S+ W        set A_i to 0
5 j1 U0 Y9 S6 u        clone 1 load to P_induction
+ r/ u; `" [9 }+ Q5 q8 H( O6 D        wait for A_time sec
2 x; m  P" \) v, j+ A0 ~    end
8 n7 h) u+ }$ C/ l2 uend5 `3 H; I. H; Y- t; m4 |: L

+ l" U0 u; a/ Qbegin P_induction arriving( I# j# c% ?! h! C
    if A_induct=1 then clone 1 load to P_pick1' f) M- c4 z, L* R/ B* B
    else if A_induct=2 then clone 1 load to P_pick2
2 e' s% U! v. i- N( B5 V' L        else clone 1 load to P_pick3
& ^) O" z; l# c5 @end7 T3 ^, i4 n2 g

& V) {. [# a2 n1 u% Qbegin P_pick1 arriving
: t1 N: W) V5 I* q    set A_i to 1
* J+ C; @8 C) b' P* {    move into Q_induct1
9 S7 @2 ?* q1 g: ?! r7 j; P7 r    move into pickaisle.induct1! t# x/ m$ M0 k; z
    while A_i<=30 do begin8 {% X: @8 j1 |" l% J. S; T8 S
        travel to pickaisle.con(A_i)5 v2 P: A" Z* D% _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ I: ?! ]* L: r5 }) a
        else wait for 10 sec0 O# ~. x0 m6 `' N
        if A_i=A_leave then send to die( [% h2 b! B( y" m$ E9 {2 L/ }
        else inc A_i by 1, Y7 e# p6 j" V
    end
3 I, d& [9 @9 {. s4 \7 ?end/ g/ ^( g. j; G$ M

* }* y, N4 y( T( Gbegin P_pick2 arriving/ x% Q3 w- E$ b+ r
    set A_i to 11/ |( w( J" {% Q0 X1 P" b* ?
    move into Q_induct2
# S$ O( Y2 h; ?  X) V$ B' a+ F3 }    move into pickaisle.induct2
' }, j. e  g- U0 s: l    while A_i<=30 do begin8 g' N! ^5 u. ~- \* d+ {
        travel to pickaisle.con(A_i)" w+ O, x0 g2 I8 k4 w8 T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( S6 [8 `7 S; |; \& a, R1 K4 }        else wait for 10 sec, e; B5 B% O- s* ~# E0 `: B6 Y
        if A_i=A_leave then send to die
* C& a6 W, r; K8 u$ h        else inc A_i by 1, l# L) N6 [' k) ]" E
    end
1 m7 A/ c% f, O8 K' J" {7 G3 Eend! x$ c$ p4 V% A; [3 U% j
( V' |) \1 \  F6 Z- l
begin P_pick3 arriving
( P% I! l  n2 {  {0 D  C    set A_i to 21* \6 i1 p8 y) t9 l& l  h
    move into Q_induct3
, L5 E, @1 Y" }  k! n    move into pickaisle.induct3$ S2 H) K( a$ `/ J7 v0 d
    while A_i<=30 do begin
. q9 c+ i" J* A; K        travel to pickaisle.con(A_i)
7 g9 u3 N; @  ^! \0 O- Y$ O        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( F% ^! [+ K2 F8 c
        else wait for 10 sec
6 P; l$ a* e: r+ T. p/ n+ Q# i) y8 a        if A_i=A_leave then send to die: g" q; M2 S! A! S: n8 T
        else inc A_i by 1# g# ?0 T( ]* ~5 }) C( G. H* L, Z
    end8 V, S' y" I; W0 h# V) y
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是个什么东东?
4 D3 G" y8 u  a3 p6 ?/ dmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  ^6 ~) A7 W2 i: T0 [' p! d/ V& Q; u. F
& n9 z) s- ?! \! CAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. _7 D# p4 ?! i& ]0 a" i+ L  Y, p: r1 b
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:/ }4 A* l3 e2 W+ C3 k
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
! y# r1 }8 m1 f8 h. w2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
# Q% }0 \5 z* O% X4 F3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, T+ Z& |7 e; {6 e
begin P_induction arriving
' e8 |* U0 `! c( a5 R/ t% E( Z    clone 1 load to P_pick(A_induct)9 h+ ?! ^% R) d
end最大的系! e4 E/ i8 n9 \: j) r1 J

; K& A, D+ Z3 A+ C% Q) gbegin P_pick arriving
  t: c' g) ?% {    set A_i to procindex * 10 + 1& r; f6 j* @2 G; L, N$ |: @
    move into Q_induct(procindex)7 z4 e3 k. Q; w, S" ^
    move into pickaisle.induct(procindex). J6 J/ u' R/ ]" D* h* ^/ R1 [
    /*check the type of pickaisle.induct(i), for your last problem.*/
: r, w4 j% J* C  Z+ C9 l# _% T3 E1 \; `: u
    while A_i<=30 do begin9 i% @" A. v  n$ ]/ Y0 k# s
        travel to pickaisle.con(A_i)
1 O5 b3 X1 e1 r! j7 {' w2 Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) x1 E; j3 w$ U
        else wait for 10 sec3 E# W' f3 p; k6 @  V: C. u
        if A_i=A_leave then send to die
! t$ _. w& n) P- V        else inc A_i by 1
9 t: R/ a4 l0 J    end0 [, {0 D. [& W* _" Y0 b4 [% W$ I
end
% v  ]' N8 I- a) ^  q9 e$ C; O
; l: I; {# u3 X9 P其中的procindex为整形,代表当前process的序号。1 U5 r/ n/ p* `. f6 z* l9 Q# u
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, 2025-6-17 10:46 , Processed in 0.017016 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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