设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15534|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 g7 n- m$ `3 b0 v' {0 J
# J8 w4 H5 U' z* C' p  B) H; f: @
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( k+ y! }; P9 l5 I! n8 v. X  C3 B8 K0 r  F) I5 \
begin P_read arriving
0 K) l" H  V- }' E    while 1=1 do begin
& U, a- y3 e$ ]8 F+ w( C0 G! v        read A_tote from "data.txt" with delimiter "\n"
& q0 j$ \" |# [        read A_time from "data.txt" with delimiter "\n"
3 X4 B- @9 A( K2 x; S2 H        read A_leave from "data.txt" with delimiter "\n"
7 s2 u0 e4 F0 q1 F5 u        read A_picks from "data.txt" with delimiter "\n"
* q; P- o  x5 u' p* W+ Q" l. b. r        set load type to A_tote6 G9 K0 v% t" e& v) d: O' [8 Z$ k
        if A_tote="tote 1" then set A_induct to 1
5 |3 D& ]' ~& @4 P        else if A_tote="tote 2" then set A_induct to 2
3 C9 B7 h. g( q- b  X            else set A_induct to 3    5 d  F- z& @0 f' O0 u8 ~5 _& D
        set A_i to 0" w: `6 g& Y- D$ ?) A, D6 y; F
        clone 1 load to P_induction
& c3 o2 K  y/ Z        wait for A_time sec4 b) O  k5 I1 v$ k7 X
    end
) x3 M- A/ }) V; C$ D; `5 N% Wend
4 k: |, S* k" T6 P" D. d& @' ^2 _( d+ q
begin P_induction arriving
2 i% {" f) J% v    if A_induct=1 then clone 1 load to P_pick1
, f$ D: y; }0 a& p; b& p9 t    else if A_induct=2 then clone 1 load to P_pick2
! ]8 v2 }, k) j9 ^3 }( G- W        else clone 1 load to P_pick32 H4 q, G% P- B
end/ T3 w9 D; f1 V7 y

  r! F0 ]4 P+ v. D7 H( @begin P_pick1 arriving
# b5 H0 Y5 O+ \    set A_i to 1. @# i/ N/ V* [1 S: g
    move into Q_induct1
% l- j: X$ \3 X/ x; M+ _/ l    move into pickaisle.induct1# t7 V( p) ^4 B2 m& M+ ?
    while A_i<=30 do begin
& n: h/ q2 L! |8 z        travel to pickaisle.con(A_i)
* h$ O. ^' Q& C5 [5 m: y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 w( i3 \+ L. J$ Q0 J0 E
        else wait for 10 sec
& o8 p) e7 Y. S+ p. m  ]        if A_i=A_leave then send to die! r2 b( S6 ?# P6 q/ K# N
        else inc A_i by 1' A/ H7 |: a" Q" X
    end; R  b' e& v6 x. h: @) M
end4 k; Q+ f0 k% k2 c$ w
  A5 e" I  Q2 r/ Y( ~. |, w2 b
begin P_pick2 arriving
' x8 H4 Y7 c3 R+ V    set A_i to 11
. U( B) \; T5 _! ]+ n    move into Q_induct2  M* r3 H' B( A4 \: i, B' g5 N. W3 l
    move into pickaisle.induct2
& ]3 d* i) I7 \    while A_i<=30 do begin
& G' y& s. U8 W; w5 e        travel to pickaisle.con(A_i)
+ G" b( P0 S% r8 F# O& L        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 E% v, h3 c) m; @2 ~        else wait for 10 sec
6 J( l# x$ \! f( I/ m" l        if A_i=A_leave then send to die
7 ]0 l  M9 _& h/ q        else inc A_i by 15 y" B6 ^+ ^# L, |3 t" W
    end. U6 ]/ m5 e2 T
end  m# R+ q- i/ [3 R

: K% P3 ~1 c: O; M8 R" |begin P_pick3 arriving
# f) J; K2 b+ ^8 I! Q) n    set A_i to 21) k" K; N1 p' s+ j: e9 q
    move into Q_induct3
% y5 F& ?. a- C. A9 y    move into pickaisle.induct3  w, E' h1 c7 h0 j( H8 U+ |- g% r
    while A_i<=30 do begin" Q; g. s: z0 u
        travel to pickaisle.con(A_i)2 f& f* t9 I3 |: R. K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" `& u4 H# x3 Y6 ?        else wait for 10 sec
3 \; c. {% k) D' m) F        if A_i=A_leave then send to die$ c7 q0 A1 |2 t' ^
        else inc A_i by 1
6 o; ?! x( y" Z1 N8 L0 @1 h% Y    end
" C& R% S: m2 N5 ]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是个什么东东?
0 O( u- V' R4 d' smove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
, f1 p. H$ m1 `9 b8 m" E+ b2 _6 g' l* Y  w5 d( s1 F
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
4 F" S4 U& l- u' [% f
/ Z7 C3 I5 B$ C( K0 K9 Z2 F2 B另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& D5 {6 V2 ?4 l1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
0 w6 L% s0 r4 {& ~/ c; G8 N0 P# q2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
2 m9 w% G5 G9 ^% j5 \) l; f* E3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:) L, l$ f; w5 s" i5 N
begin P_induction arriving2 I" E1 c: d$ d$ f3 Z1 e
    clone 1 load to P_pick(A_induct)
$ w% {; h- H6 @6 H! Mend最大的系
+ Q2 u: ^8 ?/ H# Y; M4 q, E% H" V1 c; u0 V& C0 q# @4 }5 N
begin P_pick arriving
6 d  y+ `7 h+ w: |- F    set A_i to procindex * 10 + 1
, C; N3 s7 H. Y: `    move into Q_induct(procindex), V* m$ |* i; J4 Q. C
    move into pickaisle.induct(procindex)
1 F  p' s" K" Y* T7 x    /*check the type of pickaisle.induct(i), for your last problem.*/: K8 z" Y# o/ \+ M$ n* T9 j. e
9 a% s$ o9 K; Y
    while A_i<=30 do begin) b4 N- s& f3 I. X$ o
        travel to pickaisle.con(A_i)2 h' T+ j  u9 q# H# D$ d2 l$ b
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ o5 {/ Y4 ~$ @; q" k4 Y        else wait for 10 sec, z2 x+ ]# N% r; q6 j: e
        if A_i=A_leave then send to die
# p+ ?6 n+ X+ d: y        else inc A_i by 1: P" q; i( ]7 F3 j. F) X: m0 Y# a
    end4 Z# t2 `6 ^  D+ a4 x$ x0 f
end$ q( V$ N1 r) x

2 P" ~  }5 s3 N# E其中的procindex为整形,代表当前process的序号。
) l) y5 N" ~7 R( P, J, ^6 @3 Wstation和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-9-18 16:46 , Processed in 0.017880 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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