设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12926|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. _) I6 c5 d* c9 }$ b: r0 M6 n0 x- |
7 {% a% ~* k' L% v我的问题是,在每个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 k% z/ ~. O- r. M* a8 c3 P- ]
9 H+ q8 L0 _# Y  Zbegin P_read arriving
$ m6 a, \# ~5 \; V9 b4 c    while 1=1 do begin; z$ y( r( E* T6 y" Q! Y2 s
        read A_tote from "data.txt" with delimiter "\n"
: w1 E$ q! S# C7 k' G0 C' J        read A_time from "data.txt" with delimiter "\n"  D, g/ F* @! [# h
        read A_leave from "data.txt" with delimiter "\n"
6 P2 u' s) Y# b1 f9 g        read A_picks from "data.txt" with delimiter "\n"( u# j7 E0 u* h- N
        set load type to A_tote4 Z- u# L  B$ m. t, x& \% m2 U9 I1 N
        if A_tote="tote 1" then set A_induct to 1' H: x8 s( @; U: c5 p+ \9 W/ b' ?
        else if A_tote="tote 2" then set A_induct to 2
. A* A& w' d7 a& J* P0 [2 Z( ^            else set A_induct to 3   
2 P* D3 p  C* I3 U, ^  [! B% D        set A_i to 0
- g3 V- E3 g0 I: M+ X1 I7 c" u        clone 1 load to P_induction! M' ?0 C% U1 W7 J. _
        wait for A_time sec- G& Z- j  A/ ^+ z$ o1 C
    end$ N- q/ L( e9 N5 Z  o
end; D5 g* w: p  a) }5 s
* E" o) ~/ R4 y" o, R
begin P_induction arriving
. D2 S; `- V0 |- m' m    if A_induct=1 then clone 1 load to P_pick1
( W8 J. L( a9 c/ d- o    else if A_induct=2 then clone 1 load to P_pick2
5 D* B5 w3 B( i5 _2 @0 G        else clone 1 load to P_pick3! S7 n1 ~4 [( @) `
end
, p$ X- T3 G+ x
/ _( I7 H& l2 `: V* Cbegin P_pick1 arriving
: O  h  c+ F( I0 _2 k! b+ y* G    set A_i to 1
  N$ Y: c0 g' r1 e( r3 ?  [    move into Q_induct1$ E) V' L& V- k- y
    move into pickaisle.induct17 G4 ~' T; d& Z, J* S- a
    while A_i<=30 do begin+ W3 O6 F5 K* h: X- T
        travel to pickaisle.con(A_i)
1 }0 e) z+ _4 t' ^! W        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- W- Z: Y' M1 H( b% ~6 e
        else wait for 10 sec
( @: ]( X4 I  \2 a        if A_i=A_leave then send to die+ {. s" v* \, ?% F) S8 ^
        else inc A_i by 1
& Y4 L' Y  k) \) e  T7 m/ A    end
  R- E. [: T, ]6 O7 p- a3 yend# J" l& p$ m! H7 ]2 e+ N
* R9 b9 D  \3 V" Q
begin P_pick2 arriving
4 `$ V6 J, Q: f! V9 i$ v* Y' H    set A_i to 11% n$ t$ l8 c2 W( O/ q
    move into Q_induct25 C) j( E3 y; N2 E# }
    move into pickaisle.induct2! Q5 x4 F5 n- G1 W
    while A_i<=30 do begin
& R9 Z" R: J, R! [3 `        travel to pickaisle.con(A_i)7 O, y( i# ~$ d  _" h7 E. W
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) d* K1 Q! w; C. O. }
        else wait for 10 sec5 g: X" S7 C% L& z. }
        if A_i=A_leave then send to die
) d( z8 P6 L$ s8 M( B( F3 S        else inc A_i by 1
( ?; `- x2 l9 v- c- j/ v    end
' Q7 W; x* ?2 e9 U. Q4 Wend! V! i- y. r+ N* v% q4 [

4 s' C0 l4 n! h3 h3 Z) Jbegin P_pick3 arriving
7 d* @5 y- u, l7 n, d+ \4 K, ^* [( i    set A_i to 21
3 v9 P! H8 E% f& \% r    move into Q_induct3
# V- x; w9 m: q    move into pickaisle.induct3
3 F4 K  R9 \: K  p: y1 I    while A_i<=30 do begin
7 Y7 Q* ]5 V4 x5 u/ j        travel to pickaisle.con(A_i)
0 o) m7 N) b) ~8 g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" H8 `8 m! e2 d. Q+ u        else wait for 10 sec
  F; ~# z; X7 q) q" N: P( N, ]        if A_i=A_leave then send to die
2 a. v  l5 R% ]6 y        else inc A_i by 1
$ ^) C% R# P8 I9 ?    end
7 _. r4 _2 f( U9 iend

最佳答案

查看完整内容

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是个什么东东?
5 {& z6 o& J! s& u" Y2 p2 _' `move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& M8 M9 h2 z2 `
* i) d7 u4 Y2 V! R  B2 yAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
; z4 {- E6 k5 c
7 j* B! C0 g7 T& a/ I另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, {, E$ E: V4 w# m) t& j1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
* g8 U" x) d; P# m) b& B2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;" y( g/ n8 B. h% J- x
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
5 l- N1 q, [) y' _. d% W5 Vbegin P_induction arriving$ \7 x. R0 g2 E
    clone 1 load to P_pick(A_induct)3 _# I/ e+ w* h" D: S
end最大的系
4 ~) F+ P; ~( p* p! z1 M
; Y, \5 g# [- X" j6 v) G, _begin P_pick arriving, b1 g# ^, ^" A9 b/ ?
    set A_i to procindex * 10 + 1
1 j" [* ~4 B9 x, F& y+ N& A8 x0 ^4 x    move into Q_induct(procindex)
0 f& V) J0 J3 f0 l. |& Y    move into pickaisle.induct(procindex)" [) b5 p2 Q; c  g5 [
    /*check the type of pickaisle.induct(i), for your last problem.*/
9 K/ x+ \) P" Q- f$ U; C$ n7 Y+ N4 h. d5 G( t7 Y3 i
    while A_i<=30 do begin
- i- u$ ^8 R1 f  X6 z1 o5 T" {* q) r        travel to pickaisle.con(A_i)
/ W1 \- Q/ F: O$ C/ I4 m        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" e' f+ K) ?+ f3 d        else wait for 10 sec
* x& H8 I: e. M. \5 `4 \0 m        if A_i=A_leave then send to die
/ I1 F5 p, K; F  a        else inc A_i by 1
/ ]( a8 z, _( s# M  I! ^3 g    end
% k% p- d- z3 g5 T! Cend- c3 u6 ^* [/ i  |5 T6 ~- A! P

8 v5 z, v/ T' U4 I8 r# |5 F其中的procindex为整形,代表当前process的序号。1 M. q  {# z; O0 ]: @' }
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-3-3 04:30 , Processed in 0.014475 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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