设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12971|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 d+ U/ s2 M5 O1 |" {+ _6 K
8 \+ B( V6 R) I我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& \0 f; n6 R' Y. V2 T1 ?" w* h' F) r
begin P_read arriving3 j# p1 v- b4 [3 I9 b
    while 1=1 do begin
9 P& `- @9 b. r        read A_tote from "data.txt" with delimiter "\n"
1 _6 c) T9 z( K- R7 ?/ E5 \$ s$ _6 o* @        read A_time from "data.txt" with delimiter "\n"
! b- K: Z2 t( b, i8 Z3 B( D$ V        read A_leave from "data.txt" with delimiter "\n"
6 ~) b/ w7 S) R% J7 U- c" I        read A_picks from "data.txt" with delimiter "\n"
: H5 _# {$ r& N/ D5 M1 q& H        set load type to A_tote
. @0 Y* p7 j; d; ~0 P3 o  B6 B1 N) X        if A_tote="tote 1" then set A_induct to 1
* }' X% _1 _4 u, Q3 o        else if A_tote="tote 2" then set A_induct to 2. J3 q$ u6 S) t
            else set A_induct to 3   
: q- `* i8 O) @: l3 ?        set A_i to 0) X, ^' u) h: J" W) _
        clone 1 load to P_induction, ]" _2 _- ~1 D0 T( j: G" v) r$ D
        wait for A_time sec6 l7 U5 C: @. p) h
    end0 Q: {1 T- F. h$ ?3 Y" V
end5 f) ^3 `/ p( j1 n: d. _6 R

6 K9 k) b$ }5 k9 Qbegin P_induction arriving' o3 D$ ?  P) c( Y! t9 g+ f% i
    if A_induct=1 then clone 1 load to P_pick1
4 s; R5 N  p0 B, k    else if A_induct=2 then clone 1 load to P_pick2# Y: `. o' j& E. C! a
        else clone 1 load to P_pick3& z: @$ A& M; a/ n
end4 P8 U: _+ R) o5 m& h; N$ o( o

- `5 y5 B7 c7 t" Y, j8 N- Ybegin P_pick1 arriving
- L1 X# @& q8 W    set A_i to 1
) D. h6 }/ ?5 z2 x0 U' }9 W    move into Q_induct1
/ A% v& G7 b3 \8 t6 R) E( K, e    move into pickaisle.induct1* T# o/ b+ J- ]' @
    while A_i<=30 do begin
; L  o8 W% l4 ^& e' c        travel to pickaisle.con(A_i)
# x- G# s0 y$ e! d3 K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 [, ?# K  c8 W' |/ w4 z        else wait for 10 sec) U/ ?) f& s7 P9 g. v
        if A_i=A_leave then send to die
$ N) S& b+ I2 |4 J. |  B- f        else inc A_i by 1
) t# N  W8 Y8 G    end
8 V7 l1 @8 q% w$ eend
9 c4 m+ Z2 {+ \/ H0 ~' |1 ]$ @& D3 U$ V9 w8 y/ k# I
begin P_pick2 arriving! K+ O4 b4 i$ r
    set A_i to 11% z4 s8 g1 Y, ]" f
    move into Q_induct2" j( l9 R) P" z5 P0 e
    move into pickaisle.induct2
1 z# R2 o% P+ D- u6 C4 x- X2 W2 c    while A_i<=30 do begin/ y5 q! j2 R  F9 q& T# E! i
        travel to pickaisle.con(A_i)! s/ Y) `/ K7 J+ O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 N9 S9 H9 l% y5 S2 M. x        else wait for 10 sec
4 Y/ Y  x8 Q: g7 O9 x; O        if A_i=A_leave then send to die+ }0 \8 M! p/ }, n
        else inc A_i by 1% ?( u( V% N) ?
    end  o- w* |, ~# n$ J/ D: u
end* ]& U% }" j9 s, `7 P1 p# n, M
4 o8 x3 I9 @' }' A/ K
begin P_pick3 arriving
" S+ E6 ~5 A+ K    set A_i to 21
3 U7 v! Z2 T3 p5 C4 ?# U' P  ~: u    move into Q_induct3
4 r1 u+ C7 s# J6 i$ Z    move into pickaisle.induct3; x- [8 }7 `/ Q% r! s2 E& Q
    while A_i<=30 do begin  V; `1 T2 ^7 o/ G
        travel to pickaisle.con(A_i)
. l9 w4 V) G& \$ V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( T& R" ^. F% F( s& O        else wait for 10 sec5 i2 Y" I3 I; s9 @2 O/ Y
        if A_i=A_leave then send to die; U9 Y6 U) T4 ]/ q
        else inc A_i by 1: l2 j  ~5 @- K: u+ r$ ]: ?6 P! B
    end
$ ]0 s5 ?4 H" [8 U( P/ lend

最佳答案

查看完整内容

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是个什么东东?' V! S: @( }) J/ J( N
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
( z9 D. U& s0 g& ~' W0 v& g7 [% B; Q
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. k- P% \4 ~4 S

6 P) h$ G7 A$ m& m' Q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 X! T" w) G4 ?4 {; z2 W; i* _7 }: j1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' W( {% [; x* S. N1 j! W% G
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ d% c5 j. B- r- _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 f' y2 i6 m' h3 F+ F1 O
begin P_induction arriving& [9 ?3 e4 [. y9 }" X
    clone 1 load to P_pick(A_induct)
- n) v$ y) W4 S: Fend最大的系: k) D; J: u1 y" f$ R

! H0 a6 |0 s$ B8 [9 hbegin P_pick arriving# k1 S. L6 h/ w" [' L) F* y* v
    set A_i to procindex * 10 + 1/ V# F3 r( {1 y) z, K$ a0 Z2 p  Y
    move into Q_induct(procindex)6 t8 {: n: x' P  `# B: n
    move into pickaisle.induct(procindex)' ~' [* X9 G6 O
    /*check the type of pickaisle.induct(i), for your last problem.*/( X" n' B! p' n0 Y
' {9 b& u  _) d( H; b
    while A_i<=30 do begin
5 O- [3 {  o5 ?        travel to pickaisle.con(A_i)
. i1 L2 d+ K) j6 g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& @0 }3 j. m5 q( J, [
        else wait for 10 sec6 ^! |  l" m  v$ Y6 A1 i* A8 W4 k
        if A_i=A_leave then send to die
1 r( f" T2 v/ M) d' G+ u: R        else inc A_i by 18 Z' W8 Z" B5 ]* r
    end3 N/ _) r6 H& t# v4 u
end
+ n( {' b. T7 ~+ K. V  f- k
. ^- j/ k* z1 {0 {+ f. c其中的procindex为整形,代表当前process的序号。' _- M  Z' X# W% y
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-6 15:36 , Processed in 0.020704 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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