设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13822|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" ?  }+ r; e" K1 ?# J# g/ r& m
3 ]- l' }& T# _  N; @5 \% S! q& J$ ~3 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中的数值,不知道会不会有什么不妥。
; A: ]3 T% u9 b# ?6 H0 N
1 B; X2 ~4 `1 g$ s1 A3 ^1 fbegin P_read arriving$ A3 ]6 ^% V5 n9 G* M. S
    while 1=1 do begin
; @0 r, e" X. L2 ~$ {4 r2 V# c        read A_tote from "data.txt" with delimiter "\n"1 K0 K. q9 {0 @- a0 N
        read A_time from "data.txt" with delimiter "\n"
( q: W  ^9 W& z: L        read A_leave from "data.txt" with delimiter "\n"
7 |  ~* R0 b$ w/ K: ?4 S        read A_picks from "data.txt" with delimiter "\n"
1 O' m+ x5 k# W2 N. G, [        set load type to A_tote
4 C, P& D( o5 d6 P        if A_tote="tote 1" then set A_induct to 1
  M# i0 i/ k1 R; X. ]2 p        else if A_tote="tote 2" then set A_induct to 29 T, g( C/ p& U' T1 N5 E/ P+ i: y
            else set A_induct to 3    & ~! j6 [: F, q& a! R+ R. o
        set A_i to 0
- }0 L7 r. I  Z9 B5 d: t% D4 B        clone 1 load to P_induction
; h2 _. T) o# D) n        wait for A_time sec+ f7 i: H7 ]4 @# S9 |" k6 R. L
    end& V% K, Q5 F' [
end
7 S4 A- K3 u4 X# c/ i, j4 J+ F# Y: r, {
begin P_induction arriving; y/ L2 p  H- l
    if A_induct=1 then clone 1 load to P_pick1
4 y) Z8 a# P5 s0 K9 \7 f( y1 K    else if A_induct=2 then clone 1 load to P_pick2
  [+ [0 f4 N; f3 _        else clone 1 load to P_pick34 \/ K( X- @- J8 q- A
end
, D2 r- |1 {" u# f0 a  @" C6 X
- Z2 z! d& p0 q# {+ }/ ]2 z/ M9 Wbegin P_pick1 arriving
  t6 i% w: o: s: t" i1 v' W6 W    set A_i to 1
' ?# L$ G0 P! i5 f  Z% J    move into Q_induct1
, [* N* C9 x* u6 L    move into pickaisle.induct12 J: S* N0 G/ s9 v4 m
    while A_i<=30 do begin
5 a" B- v, [  E+ R$ K$ \# ]        travel to pickaisle.con(A_i)
- @# Z' J/ |4 |3 ^        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' J# M" D0 V6 g+ U& f/ J        else wait for 10 sec2 W: \5 o5 G/ V: w) B8 \+ ^
        if A_i=A_leave then send to die
' k8 n! p6 [8 X& }: B9 `        else inc A_i by 1* ^) d  I' U, E3 a# `0 u& w
    end
' y3 c: W  M4 Eend7 h6 r. T: q! ^4 D2 |

: m! y7 P1 O  d1 @7 j0 ebegin P_pick2 arriving
4 A3 `7 }# m  H& x% K/ g# ^3 s    set A_i to 11: P/ u" s- c: V0 U" E
    move into Q_induct2) ]0 K8 o& O$ S: H! I
    move into pickaisle.induct2- S. H; R! C$ O) B8 H# @7 W
    while A_i<=30 do begin
* e5 A$ m) A; b0 N0 w/ L  b; k        travel to pickaisle.con(A_i)7 ^( _. L/ a6 _. h+ A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' I' Q; t0 X( S* Q' r0 n
        else wait for 10 sec
0 _( ]# A2 l: b" Y6 _) O# e1 p        if A_i=A_leave then send to die, y, d, z; |! I* R
        else inc A_i by 19 U$ h* w7 H9 W7 y% L! s& w
    end9 k) Z) X( X6 {0 L7 T
end
- o" q7 J0 @( h! X* D# e# t5 w/ W1 m8 J/ o' }
begin P_pick3 arriving
8 W# @5 p$ Y4 E% g3 c    set A_i to 210 T, b: V- I% E
    move into Q_induct3
" r- c# K" Y- e/ p- q' l  l0 E, J    move into pickaisle.induct3; }) ~0 _, J$ q8 R( K+ F2 y
    while A_i<=30 do begin
& W& ~0 @3 v2 Z$ q- Z        travel to pickaisle.con(A_i)
( Q; J5 ?: F; k% Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; c! a' C2 {9 C  R* l# Z        else wait for 10 sec
: p& |( M9 ]6 v" \) u        if A_i=A_leave then send to die4 _% k6 ?- A" u1 x6 m* h) ]- H
        else inc A_i by 12 u8 Z6 H/ |9 |6 s: f- C3 e* i
    end
# d0 T6 h' T2 oend

最佳答案

查看完整内容

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是个什么东东?/ ?3 {$ Z. E  Y$ N% {. _, G7 Z
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' E) O5 r* s4 F) U' v
, \9 ~# p# a) E# Q# b6 s7 gAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 s1 Z; O; R+ _# n1 z( p0 b7 k& C7 L' T
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:! w( d, J& K- F0 [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 l* f0 ?. n' q5 W7 Z! u, K2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 X% x, s( \- q1 R0 M: M
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
! M, ^7 G0 N+ b& E: Abegin P_induction arriving
" s3 [! B; w! T$ Y    clone 1 load to P_pick(A_induct); D# t7 M0 {3 N  h6 v
end最大的系
! H1 `; a: S1 a' r5 I5 ~9 _9 R# r. r* f0 s0 N7 v& t% L* x0 x3 Z
begin P_pick arriving
# m- m7 S9 u. J3 }4 j( w. m    set A_i to procindex * 10 + 1
! O) T* r7 l, B/ A% M    move into Q_induct(procindex)1 f! x" [' J. p. K
    move into pickaisle.induct(procindex)
* A1 V4 A6 a4 ^8 i2 {9 N8 a/ I    /*check the type of pickaisle.induct(i), for your last problem.*/, q3 j3 n! u# V. U# m' }- ^
4 f! }4 m- V! c8 x
    while A_i<=30 do begin# }$ F" Z8 Z) S( W9 ~( v' o9 h
        travel to pickaisle.con(A_i)
0 M6 I2 r* U; e5 H% O9 A- w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- ~, @/ o4 }- B* c* j; j        else wait for 10 sec% [" n# d% u7 f2 c/ v
        if A_i=A_leave then send to die9 o, C! B! N2 W9 M8 b' p" o
        else inc A_i by 1
* F! Y/ S" f2 `; y: x/ r% y( K    end* x9 R$ j5 L6 N8 L) R
end
5 P  i: q. S, @: h* [" @# U1 p6 j2 q! U2 b: [6 Y
其中的procindex为整形,代表当前process的序号。2 u9 T- k6 Z/ K2 h; k
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-5-8 14:58 , Processed in 0.016307 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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