设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13969|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 }+ n0 C8 G5 W& H
# a( Y. O) E5 c9 z1 ?* ]1 M3 N我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ U+ s: U  l: }, S% y

: }' S& J, k3 Q9 @+ T' X: ~begin P_read arriving
0 ~+ B- U) o5 a8 k, P1 n/ U    while 1=1 do begin
, f" A) o$ G9 W  V& |+ W( u        read A_tote from "data.txt" with delimiter "\n"# D9 ^, @8 b3 H
        read A_time from "data.txt" with delimiter "\n"6 r" e; h# e: C/ m
        read A_leave from "data.txt" with delimiter "\n"* `( [: X9 M; ~6 G0 `, D0 n) g
        read A_picks from "data.txt" with delimiter "\n"
  x+ P* e6 D; m- o' K1 _        set load type to A_tote
8 y' p# W2 K) x. {, R/ P# C        if A_tote="tote 1" then set A_induct to 1/ E, E! J# {3 t- `
        else if A_tote="tote 2" then set A_induct to 2
' F6 l" i# n) |( M            else set A_induct to 3   
5 X3 J8 ^9 T/ e        set A_i to 0
( o; z: l- O+ b9 |  V        clone 1 load to P_induction. O# D; l2 t2 E4 m( n& e& v
        wait for A_time sec
+ P9 M' Q8 y, ~7 i    end- B5 J, k& a; B. M! v9 G! Y
end( r9 K' B' H/ C9 n: p  n
' x3 H" K: Z( s# d' @4 J  _
begin P_induction arriving8 m6 F1 L: z) i9 S) Y
    if A_induct=1 then clone 1 load to P_pick1
( _9 ~' [6 g, w0 w: @" p4 J9 G    else if A_induct=2 then clone 1 load to P_pick2
0 A% {/ \- V6 U        else clone 1 load to P_pick3/ Y4 C" C% C3 [- o6 f8 h' l
end8 n4 _9 w- J0 h3 Z
% l# s* ]( q* W2 ]4 g
begin P_pick1 arriving; z! f5 u0 \9 E8 Z: d9 p0 o$ n5 W; g
    set A_i to 1
" x* ]" Z/ |( n# C) d( k    move into Q_induct1
, h5 q' U4 |% V# Y& j! X  a5 v    move into pickaisle.induct13 i( z, R% j7 C! j  m
    while A_i<=30 do begin5 F5 O, S% j" c( c3 U/ D
        travel to pickaisle.con(A_i)% f6 \( H& m. a6 O) G( }0 a4 A
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, M$ n4 V! L1 h8 Z        else wait for 10 sec& j' e* ^$ H( j. |" c
        if A_i=A_leave then send to die
# f/ H* r8 H  m) a# [; a5 S        else inc A_i by 1- {+ n6 f5 d7 v& i1 r
    end
. W9 n0 G' ~; ^% _7 A  z, Tend$ ~, G& I0 y# E  ]! h
; Y  m0 t1 {! ]  c4 Q
begin P_pick2 arriving; R# a' V/ A0 M/ O. ~4 w3 b
    set A_i to 11& X2 \/ X# O+ {$ m, M
    move into Q_induct2- `8 T, a% Z# w
    move into pickaisle.induct2  c( Y  p3 V1 d3 B/ j
    while A_i<=30 do begin; c! ^4 Z7 M& c) G% N. y
        travel to pickaisle.con(A_i)
" K% a( m( L" ~, G! D2 T" s( u: }        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 e: O& ?+ [; V; j2 x) y3 b        else wait for 10 sec1 s/ [7 W$ |) f6 O5 O# N
        if A_i=A_leave then send to die
' N! P  Y0 y; x8 [        else inc A_i by 1' b4 U, s  J/ D
    end* Y9 c9 j- t! D+ _" @& l6 k9 P
end
2 n2 a" ]/ W$ K  Y4 X6 _8 m$ a& B" V$ S; m
begin P_pick3 arriving
1 ~' ]6 ]4 j  d4 z    set A_i to 21# f8 X$ |, Y- \- X
    move into Q_induct35 S2 z0 W: @, v- g3 A& D
    move into pickaisle.induct3
! A9 F" s! ^2 n& G" N( |    while A_i<=30 do begin! X, o" N; I$ l+ z
        travel to pickaisle.con(A_i)7 t) X7 p" f0 C. p
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) H% ~! [0 e! r" N1 o; V" r# _& P0 r        else wait for 10 sec
& ^' D+ i; f& @' N5 _( L6 |3 D$ X) ?' e        if A_i=A_leave then send to die
7 e9 l1 ]8 G: o# F- ]2 w        else inc A_i by 1" U7 ^. y. Y1 a* K! d
    end! E% d: W0 z% m3 [- E
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是个什么东东?- {6 n/ B3 F2 }; K
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, @1 d4 V% v+ o' F/ X  r# G; t. d/ t# i3 D4 H) X4 K# \
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。/ ?2 `1 W5 ?3 D, Q

, L4 J' S4 N' S5 H& G6 z2 T另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
  p- D; G$ J: y1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;$ h7 f# U% A8 a, |4 ?/ R+ s3 U
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
+ Z8 I3 n2 n% ~, J$ e. [3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:  u4 Z0 u# a8 `, s5 s1 Q
begin P_induction arriving
: Y8 J  i! S! I5 s: ^2 j    clone 1 load to P_pick(A_induct)
  b2 n2 p: D$ Z1 @/ o$ Xend最大的系' T0 ~; [' ]+ I: \4 M

: ~2 c  y% A# l5 E7 x: Rbegin P_pick arriving
# K- ^% z7 m2 F    set A_i to procindex * 10 + 17 }% t7 i/ g8 L
    move into Q_induct(procindex); `+ o* S+ Q7 B% c8 Q
    move into pickaisle.induct(procindex)* V8 H# A1 m& B% i9 m+ w
    /*check the type of pickaisle.induct(i), for your last problem.*/. w+ D" n1 Y  R2 x4 ^* f' q/ u/ e
8 N3 u5 p0 Z* o: o5 A
    while A_i<=30 do begin$ ~+ B- O+ _; |! Q2 r2 _6 R& x
        travel to pickaisle.con(A_i)
& h  m4 f) N3 o7 `8 Y& |# Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' @9 p/ h& X4 h" P
        else wait for 10 sec9 g- f) ~. z9 A- \/ m* X1 d- H/ f
        if A_i=A_leave then send to die0 m) K; u$ I0 p- ~( I* B
        else inc A_i by 1. }; L( O6 J/ T
    end. Z5 J) k" _9 Y
end5 A/ ^. q7 y  k& x/ r! H

, E7 J" _7 V0 Q0 |( Y) C5 |其中的procindex为整形,代表当前process的序号。+ h2 t0 S" ]; J# C. s
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-25 20:59 , Processed in 0.020440 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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