设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13125|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& t8 r5 T7 |* C8 B/ J* _. V7 t% X7 R5 Q5 J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) e3 @. {$ ]3 I( g- f
$ F, Z) o. G; E0 @( Z# \  m& R  `begin P_read arriving7 _/ I% w1 x3 ]+ @4 j
    while 1=1 do begin) B: j" c$ i7 L8 N
        read A_tote from "data.txt" with delimiter "\n"+ t7 H6 O* X( C  ?
        read A_time from "data.txt" with delimiter "\n"
. y9 `. K- c5 [/ Y5 j        read A_leave from "data.txt" with delimiter "\n"4 W/ J& J1 L# n
        read A_picks from "data.txt" with delimiter "\n"
2 i7 E( o! q' w: x' H3 ~& N        set load type to A_tote
7 u, p* [+ F( J: C* l        if A_tote="tote 1" then set A_induct to 1
0 s  _. a; s& T6 b        else if A_tote="tote 2" then set A_induct to 2
+ D5 [( M6 W7 a0 F* E            else set A_induct to 3    / @, I9 [* w; ^5 I
        set A_i to 0( P* D( S, [4 l% q- L+ Q) |4 x
        clone 1 load to P_induction. u8 x8 X  l7 c, @
        wait for A_time sec* L8 N5 c. Y& R; F. ]: H/ D  b
    end
: `+ r3 \, J; J4 b/ {end5 ?  f6 n% A% r9 X9 L# x
$ d8 C1 P3 @  Z6 y: U3 w) L
begin P_induction arriving1 L  z6 A1 l# i
    if A_induct=1 then clone 1 load to P_pick1
' c( U$ n7 @9 Z  e% G# Z    else if A_induct=2 then clone 1 load to P_pick2
: k1 e6 b5 {  q$ i# y        else clone 1 load to P_pick3" y4 W; K3 q' `9 B
end4 V& L6 _7 M- x% q9 m/ Q5 H
, T3 g2 n; A- c1 ^
begin P_pick1 arriving2 E/ m0 K0 ^( J' c3 I
    set A_i to 1& f4 y/ [- c- v
    move into Q_induct1, d( v4 f' F4 u. X. C5 N
    move into pickaisle.induct1
  I/ ]& D" h; w* p  r; ?. h    while A_i<=30 do begin9 o2 T' [% J- O4 S- d, t
        travel to pickaisle.con(A_i)5 b' ]: ~7 Y9 ?5 `$ N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 D$ \- f6 s4 c# J. D& C0 U5 N
        else wait for 10 sec
) z; ~7 j& T/ N) P        if A_i=A_leave then send to die
! y: p& T" ~1 b9 a# V+ `        else inc A_i by 1
/ a# z# ]1 c3 b: ]) o    end! E8 f6 }6 }% n% e) i/ Q
end$ E+ U' s2 L( W1 D

3 W, U9 g3 |5 J% M( T& pbegin P_pick2 arriving, ~- m5 A* f% [* k& R3 D" d* |3 ^
    set A_i to 11. J  m5 @3 N. U& \
    move into Q_induct2
  O# N! g, c! I* V; }" H    move into pickaisle.induct2
. A  u( U" r# O  _$ k' {    while A_i<=30 do begin
; z' l& S7 @4 ~  C/ I) O        travel to pickaisle.con(A_i)
4 l4 k5 L) F( R        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) w7 A4 r+ U+ _& x5 ]  e7 C0 K        else wait for 10 sec" r9 z9 F* d8 w" d+ G* |& j
        if A_i=A_leave then send to die  F; x- }8 n* X; c1 w" ]' q4 h
        else inc A_i by 13 I" y9 ~: p7 i# d2 t& s$ C
    end
2 n& s# g; S! f; h( Gend- }. k4 T! \! `$ `8 a4 W2 c' r! R* t

4 }! S/ n* e6 t6 u: Vbegin P_pick3 arriving* E3 A' q9 l) l, b: V4 Q0 t
    set A_i to 21; {# q' S4 a# R" A+ g5 V* G
    move into Q_induct3
+ x  m: b0 N3 F7 q6 A4 x* W    move into pickaisle.induct35 E* f3 n. f0 n. S
    while A_i<=30 do begin
, h9 t; S' U( h5 O0 [        travel to pickaisle.con(A_i)  ~: z% _( [- M/ r* R8 K& N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 b2 {: M4 U9 g) l        else wait for 10 sec# Q% |& y2 q3 F  b
        if A_i=A_leave then send to die
/ y6 w. N+ S! e  g* q        else inc A_i by 1
( H  ]! [7 I$ k    end2 o1 ?3 S, r) m4 m6 z0 G
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是个什么东东?
2 S" P1 z/ C; B$ ^& [% [3 amove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- f* g5 v+ M9 r$ s' M/ U) Y, {3 `8 R

/ ^' R: \1 |3 Q+ z0 _8 X: BAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* _% @4 W0 r4 S8 {# \, d0 r4 p
  ?+ |* r" }* F# u/ }4 {
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ `; V9 s! t5 T" C9 @
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
# m2 j& Z9 a" t  S  s6 `. ^- L, U2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;, H0 P- o% e! ]5 @
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
$ h0 s3 j- Q. d3 j% Q2 Y5 z5 Mbegin P_induction arriving
  w" m9 n8 N% F) a4 r8 }, i" s    clone 1 load to P_pick(A_induct)
; f6 u$ e5 E3 x& }end最大的系
! Y; C8 T; U( P/ S7 v9 z, ?4 L: n/ k- c9 D
begin P_pick arriving
; c' O, @5 F4 a2 R; L7 \    set A_i to procindex * 10 + 1& i) }9 y' C$ e  E  [
    move into Q_induct(procindex)$ ~7 j3 _/ L# U7 P
    move into pickaisle.induct(procindex)
" v4 E' ]: s, s0 _# |' ]! V    /*check the type of pickaisle.induct(i), for your last problem.*/
% M0 e' ^$ X8 H) a0 M! \
9 B9 e) Q3 G5 |* z) d( w" [1 }  `    while A_i<=30 do begin1 _7 k- V" J. T
        travel to pickaisle.con(A_i)6 M' A: d$ p9 _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 a; N3 L& H* K" V0 U5 h" [        else wait for 10 sec
  l# `) j; [3 e; J9 W7 T" F$ ]7 Q        if A_i=A_leave then send to die
; E/ X' n, U6 p2 F        else inc A_i by 1* e6 L+ Q% i2 d/ l, m: e$ m
    end
( t' o! q: z: k' S' A, jend
! w6 |& A, i: |% \3 U2 {) {: P
& l3 z4 M, t1 _+ I( c其中的procindex为整形,代表当前process的序号。
8 R: v' B+ I7 h6 E4 ?5 r8 Cstation和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-21 02:29 , Processed in 0.017911 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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