设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14202|回复: 2

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

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

$ y1 t; U, i$ J$ F  o我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 z) s6 D' B" e' C/ x! L. X/ U5 e9 ]8 c% R
begin P_read arriving
7 s  ^- q" c( B: H  l    while 1=1 do begin
0 ]. d# X- o4 V  Q' I5 E        read A_tote from "data.txt" with delimiter "\n"* k8 q' u" U+ A
        read A_time from "data.txt" with delimiter "\n"& h) P. v, j( \3 I4 Q" |
        read A_leave from "data.txt" with delimiter "\n"3 q; Q- ]7 B$ F$ @+ {6 q
        read A_picks from "data.txt" with delimiter "\n"  c+ T! n( i2 n1 }$ o) \5 _
        set load type to A_tote+ Q; y3 }/ H, d+ G
        if A_tote="tote 1" then set A_induct to 1
- Q$ o$ K$ x3 q, w6 j8 O. [        else if A_tote="tote 2" then set A_induct to 2+ H* U# F" ~6 ]$ s
            else set A_induct to 3   
9 u8 |3 y5 S$ _2 E5 ?& A        set A_i to 0* e* G& B0 N4 q' [2 A' S6 Y5 W
        clone 1 load to P_induction
0 R" J3 K- O5 X5 D# V7 Z& N        wait for A_time sec' w! r4 c9 ?$ S/ s. M$ L  p
    end
' U5 w4 K) z7 c. Y: nend% I. F/ e+ c0 d, q) ]

6 i' r4 E: r! n: N7 s7 T9 wbegin P_induction arriving
% k1 y: l7 E% E    if A_induct=1 then clone 1 load to P_pick14 |  E& C5 b9 Y3 n/ A. C4 v
    else if A_induct=2 then clone 1 load to P_pick2
! q! a9 S: Q* d$ {7 c0 d        else clone 1 load to P_pick3/ S+ L2 J7 l& H/ q
end
8 a; ~. ~" I' B4 c% J% `1 e: p4 h8 `) k4 K. Q
begin P_pick1 arriving
9 b( b: s) l, j+ k6 u    set A_i to 1, N) j+ b) E+ c! z
    move into Q_induct14 L* H! S: P- d9 L' O9 F8 }& o8 l
    move into pickaisle.induct1! R1 e* V  W7 _6 E) W- e. ]( s
    while A_i<=30 do begin
' K( U" X8 _! S5 @        travel to pickaisle.con(A_i)+ U" t- ~# l1 ^/ l8 z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 N( z  a, |/ S' o        else wait for 10 sec0 z) E" y7 J0 @2 C7 }! m4 X% T% h
        if A_i=A_leave then send to die
( a% u+ ~- L* g1 M! K3 A        else inc A_i by 1
5 l$ K0 q/ R0 E    end
9 I9 M# [8 P; D; C! P4 N5 Cend
. p6 X$ b3 N- `8 c$ A6 b7 h! W3 h* t4 Y# O3 i9 e) B- c! G8 t- i
begin P_pick2 arriving
% U3 _6 P+ k+ Y9 ^: {: [    set A_i to 11
, D7 ]( t7 x' G    move into Q_induct22 C5 }% X4 k) Y: F5 ~( _# O
    move into pickaisle.induct25 N  ~/ U0 @$ ?- z; v7 R
    while A_i<=30 do begin
; B( ]% S5 h/ ~- k! B        travel to pickaisle.con(A_i)4 D0 |5 O8 S7 P4 J8 i" B3 p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; f* s( \) D3 n, [  t        else wait for 10 sec! ]0 E! O' P: [0 j; d
        if A_i=A_leave then send to die
3 S! J2 x, E) R6 k        else inc A_i by 1+ t3 |! F! Q" @% Z
    end) N) F7 q  |/ q3 {* G: L# l
end
) p7 a. O) L( I& ?$ o
6 T6 P* X9 I& w2 u  ]! tbegin P_pick3 arriving
3 ^, C9 L/ H; i8 a( R' o- ^6 K    set A_i to 21. J4 O5 c1 a+ _
    move into Q_induct3
, p) I+ n+ p4 o- J& x9 n' V: K4 L0 T    move into pickaisle.induct3
. r1 R5 X; r8 _# H- q    while A_i<=30 do begin  a/ F) V" Q& l. D" _1 _* Y, d
        travel to pickaisle.con(A_i)8 \/ D  u, z$ P) Y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' D6 E- X# ]+ f$ A5 f0 I8 _
        else wait for 10 sec4 P/ M! y7 x) E* u3 S" Q  ^% t8 J
        if A_i=A_leave then send to die
9 U- u, W$ r1 y$ q$ \% v        else inc A_i by 1
7 F- |$ j  h, ?+ L, p  d8 ]2 ]5 a    end0 ^- _! U+ O. h( L! a$ ^0 x
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是个什么东东?* ]* ~& [7 I" k. Y3 @
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?; x, u4 i' r4 ?8 e0 w

5 h4 X( E2 A( N8 R! gAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。- e! V0 }9 O+ Y& ?
0 _9 b' T& _" T7 H" k9 }
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
$ O& Q3 l# v0 Y% L7 i# Z* D+ Y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% `( N* m5 a0 ~( }2 R) h
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;9 a" P, j' P2 q* @
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
7 `2 H% E: D  i: b0 `begin P_induction arriving
  [! U* A$ i/ i5 ~0 F+ N    clone 1 load to P_pick(A_induct)+ u$ M% E$ T. n+ Z
end最大的系8 r. f. W9 J0 f+ s, f

) @2 y  b) w2 U; K) nbegin P_pick arriving% u1 c5 a+ D/ K
    set A_i to procindex * 10 + 1% [2 r1 e( M3 \/ I  g
    move into Q_induct(procindex)
/ o( D. U4 R  W, l% b1 Y" E    move into pickaisle.induct(procindex)
4 Y5 k/ p; x  w. J& ?" X4 U    /*check the type of pickaisle.induct(i), for your last problem.*/6 w6 p9 b! _% n
* o8 f8 Y4 h) Y2 e! r- ?& E
    while A_i<=30 do begin) ?: U1 G) f( B. f$ s
        travel to pickaisle.con(A_i)
/ K5 _1 R4 [- W, P$ [2 v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! F' m( q7 K# T, Y9 g( C
        else wait for 10 sec' @, p" `4 c! Y3 \5 A
        if A_i=A_leave then send to die3 O: i2 U0 S$ y0 b, u
        else inc A_i by 1
+ E( X7 x! G4 ~) ^4 r' A. [0 G2 r    end' s4 r, q, k. z
end1 H9 {% D" a4 `
0 j$ t& d! [2 v4 h. c/ c
其中的procindex为整形,代表当前process的序号。, v' i) n6 T0 Y
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-6-19 22:09 , Processed in 0.015454 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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