设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12400|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' T* B6 m, d( t. h' g- F8 h' [" \* s- \; j; T
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 ]6 ~: ]; ?# t0 F# ?; @# r! a9 f" c" Y, U
begin P_read arriving
/ o( z) m/ L& m  \! ]! H- p    while 1=1 do begin
% X: |0 ]5 u3 m- @! ?) {        read A_tote from "data.txt" with delimiter "\n"( k  g- g6 W: d% z( w4 W; W
        read A_time from "data.txt" with delimiter "\n"( u; ^. }, ]/ F, r9 l' ]3 U
        read A_leave from "data.txt" with delimiter "\n", c2 J0 t8 o6 r
        read A_picks from "data.txt" with delimiter "\n"! w& z0 e$ M  P' `: n0 b
        set load type to A_tote
7 H3 L5 }& R) G' O/ K        if A_tote="tote 1" then set A_induct to 1  i/ C9 a6 S; d" e9 I7 N
        else if A_tote="tote 2" then set A_induct to 2
& O/ Z/ l/ c+ u            else set A_induct to 3   
$ C: L. V3 m; m. V" H! S2 S        set A_i to 0
& h8 \, F" Y5 d! k9 _" J# Q; ~4 y        clone 1 load to P_induction; z# O6 j% G) _5 ]7 v
        wait for A_time sec+ j) d# m; Y* ]) ^( j8 c. |, `
    end
3 F; u* C4 q  q* ~end
6 K) A5 y& A7 I6 x9 ]( i  N
( N' C1 F6 X# d& }begin P_induction arriving2 _7 r3 k/ ^& H8 G' N8 I
    if A_induct=1 then clone 1 load to P_pick12 u) S, ]" r' W% ~4 @
    else if A_induct=2 then clone 1 load to P_pick23 A, P) e0 S8 k0 T6 \) M
        else clone 1 load to P_pick3$ }) c6 R9 K# a9 O; |
end6 @. q' y5 w8 ?% N
5 t  M+ g4 K( b. d5 n- D; I' a4 H
begin P_pick1 arriving. I2 W4 R- ~" {  I( w6 B
    set A_i to 1' B6 I( z2 ~- T5 }1 Q+ J
    move into Q_induct1
0 \# N% K; v. q4 t1 F: g    move into pickaisle.induct1
5 N% v: q7 M: `    while A_i<=30 do begin
( h9 w- @) i" z        travel to pickaisle.con(A_i)2 v2 O+ N1 [- _( p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) K+ a) L2 m9 R. f* g
        else wait for 10 sec
/ q$ w' d$ D9 v6 c+ A% j: E$ e1 Z        if A_i=A_leave then send to die  Z4 }! w% t; s
        else inc A_i by 1$ [* t0 C( j& t  [1 w6 ?
    end6 F; p0 |8 W' X3 @; {$ p
end
# J/ \' t! l; n( I5 ?; b# d7 P( ^0 C7 s( I9 k% C. U5 k+ E, ~
begin P_pick2 arriving
8 X2 [4 Y8 }/ m+ _  `    set A_i to 117 c9 |* L3 g+ S: y4 d/ h" O1 J
    move into Q_induct2: `6 P8 F) ?! L# V0 a3 E7 n# G
    move into pickaisle.induct23 j* F# w9 a- S7 a
    while A_i<=30 do begin3 {3 ]$ l' {5 i- J
        travel to pickaisle.con(A_i)
' }% Y$ f( s8 k  X        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ C# a7 t  v& t7 m5 [' b$ A        else wait for 10 sec
/ ?8 X; _9 k* v: o% g        if A_i=A_leave then send to die
7 V; l$ S; }* ?9 I        else inc A_i by 15 V0 i$ b4 ~2 R' {5 C& h' J9 ^
    end
0 Y6 T$ y! l5 C7 g' N. Hend
0 G( j% ]1 M3 i/ o& h* e+ T0 Y, z! T# I* C& R2 `0 d' S/ E
begin P_pick3 arriving
; S$ f' n: t  d1 W- S# w    set A_i to 21" S0 {) u" Z0 a5 {8 T! G$ h4 J% l
    move into Q_induct3( S7 {9 [+ d4 P2 {' `+ {6 J* D8 n
    move into pickaisle.induct3
$ C9 N2 @) p- d    while A_i<=30 do begin
1 s) B/ p8 _+ ^4 K2 c$ |0 c% M        travel to pickaisle.con(A_i)) h6 G1 |2 t; ^4 F+ R5 g
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ T, q) o4 g6 l1 c/ y) p
        else wait for 10 sec
. i& q% j+ V3 B        if A_i=A_leave then send to die% ?6 j' A* z( F6 s0 q  ]
        else inc A_i by 1
- ?2 i* l' g( K' S8 n3 H$ G    end
6 n* g# ?+ }' o- k. D0 fend

最佳答案

查看完整内容

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是个什么东东?
' D; |7 O# u1 a- P, I% f! Mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
! B! s6 ~7 M6 H4 p! F6 C$ }' {8 k! t9 G. [8 U0 C
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: ~, K* c4 W' J( c
7 e/ x! h) u7 ?7 c
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:% g; w6 L1 `2 M$ E6 C1 t9 T: h
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;; ], X7 \( d  R  [
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ S6 m9 M) ^8 |2 S& l7 W3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 y' l' \# }  |8 C' M- }
begin P_induction arriving
, Y- B; C9 I" H0 S# L" I- \% }3 {    clone 1 load to P_pick(A_induct)- h$ Z$ v4 \2 Y" B# A( P
end最大的系
3 N8 }  T; J. G' Y* e  {" n5 F0 G3 _; I) X1 F! p' C( W* J
begin P_pick arriving  }% p9 z( u9 A7 @; `, s: [
    set A_i to procindex * 10 + 13 c7 F3 F8 c& f2 h0 B1 Q  C7 l+ [
    move into Q_induct(procindex), y+ e! A: M/ ^- O1 ?
    move into pickaisle.induct(procindex)6 [" T2 `# C$ E: z0 O& ?' E$ t
    /*check the type of pickaisle.induct(i), for your last problem.*/' e7 K$ x1 Q- y5 e+ y3 `' x

; c- e" ?' V( p' C' A    while A_i<=30 do begin( t' N. T3 h" @# k) q
        travel to pickaisle.con(A_i)
" \% A. D5 O  q" L7 \9 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: `; z- G# B! g5 z
        else wait for 10 sec
" {- {5 `/ P( |$ ?* f        if A_i=A_leave then send to die" Y" x, P, U! G; s! y" E
        else inc A_i by 1
2 d4 }* ]$ D% J( h. u; `$ r. }. _    end
" v$ f8 E, E9 i7 \/ p  X8 kend
1 i) y4 R- K# p; c0 s- Q% F; x* Y, M% ^( k4 A+ Y
其中的procindex为整形,代表当前process的序号。
+ ~" m' N5 c* }; {2 Y9 ustation和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-20 20:43 , Processed in 0.018859 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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