设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14039|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 k+ w2 [' n' [

- Q9 n! R+ C, g/ 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中的数值,不知道会不会有什么不妥。
1 z7 Z% i6 Q. E8 }1 |+ q- D2 H" _8 s! W* M" Z
begin P_read arriving! `; b2 U4 b7 L, R
    while 1=1 do begin, W4 Z1 g$ f9 g, X% C- x# `
        read A_tote from "data.txt" with delimiter "\n"+ I8 k) q+ f  v0 I
        read A_time from "data.txt" with delimiter "\n"
) \& a: h" U5 _- l" d& D        read A_leave from "data.txt" with delimiter "\n"4 e; o* V$ D" s: Q
        read A_picks from "data.txt" with delimiter "\n"& p2 _: a1 l+ T
        set load type to A_tote8 e/ x3 x7 J1 e6 {5 L
        if A_tote="tote 1" then set A_induct to 1
- P. H6 g# ]8 z+ U: }        else if A_tote="tote 2" then set A_induct to 2
: U8 r1 y: n/ m4 O! [& j            else set A_induct to 3   
4 y1 a! \+ Z4 L, l; J6 V        set A_i to 0/ ?* M) J# u; v' z" Z0 \5 r
        clone 1 load to P_induction
: F4 O' a+ k. L" z: x        wait for A_time sec; X, \! S# f, ^$ v  v$ K
    end9 r3 V5 B! F; B! `4 g
end' r3 ?4 C! w2 N" \/ j6 g

8 y* L+ V( U  O3 Q+ Pbegin P_induction arriving% Q5 F  T# y& ]1 g, d2 X4 a! ]
    if A_induct=1 then clone 1 load to P_pick1
( z! ]2 f  W1 m* u0 l    else if A_induct=2 then clone 1 load to P_pick2
$ [+ A+ d8 [" E) j6 f; _6 P        else clone 1 load to P_pick3
/ g3 a& e3 @" D7 h; {1 |) i; V6 X8 Rend2 ^3 \; i$ L: n! P7 _7 b: t# X
8 ^0 p( l; X+ [' c
begin P_pick1 arriving; @% Q2 r" E6 i* W5 L9 n7 E
    set A_i to 1
2 i' Q1 V( W5 a1 `3 |    move into Q_induct1
9 ?& y0 [& r2 Q: l    move into pickaisle.induct1& S8 c9 D+ x( N( L4 [2 B5 U7 q
    while A_i<=30 do begin- c: ], H, i: _% G8 ~
        travel to pickaisle.con(A_i)' }( N0 G3 @7 \! @$ Y7 a' m+ m; S
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- _% v- U0 Q' b1 H! y
        else wait for 10 sec) R1 J! _. p! |: r1 s2 _) f+ e
        if A_i=A_leave then send to die5 ^! o$ t( c- C8 d( f4 e
        else inc A_i by 1
0 k* m% d( |1 Z/ N+ k5 B    end
3 |' A' ?0 o& t) _/ Aend
; ~! [  R( O) p7 b+ [
- b" h$ I+ H! U- q/ p/ q6 A0 i; cbegin P_pick2 arriving
& }; F6 i  O$ |& G4 @! v) Q' U    set A_i to 11  G5 r/ x1 a9 h2 V* `
    move into Q_induct2
0 O5 I) w4 W$ ]5 C0 J    move into pickaisle.induct29 n3 R  A7 I* @- V5 U
    while A_i<=30 do begin" M2 {+ A2 o: _$ d  u
        travel to pickaisle.con(A_i)
  G# o! N* T3 q4 |& K2 X/ O8 z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 O! Z" i+ C( w* `8 j
        else wait for 10 sec
5 g3 B2 J% @* F' N$ v* L3 X* A/ M        if A_i=A_leave then send to die
1 s( Z  v: x; H9 w4 J0 Q; |* Y        else inc A_i by 1: i, ?8 ?. d, D: w: ^1 Y7 W
    end% w4 P2 f9 ]! `
end* |( J1 ]1 T, Y. j% }

/ L- B1 L6 b8 u6 {  M4 |begin P_pick3 arriving- W  F5 u; Y. I9 j
    set A_i to 211 ?+ j7 I$ Q7 h- G& |  e2 _
    move into Q_induct3- U. q$ l/ t; z- h7 S! m% |& n9 t9 W
    move into pickaisle.induct3
# K; J2 j( H; T* P$ Q- r) ?% ]" x    while A_i<=30 do begin' |4 ~" `; W- _' `4 _
        travel to pickaisle.con(A_i)2 d, l# H6 w3 E4 d: p6 q# l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' c" u+ ~7 P- l) L        else wait for 10 sec5 N4 Q: }' {+ j: h, T3 e
        if A_i=A_leave then send to die
( r9 k  j3 L( R; H; t0 x        else inc A_i by 1$ Q. `" P9 w! b( P3 _9 [+ ^
    end
. I  g  \% O: zend

最佳答案

查看完整内容

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是个什么东东?
$ U+ h/ t3 j6 H) v/ d0 Bmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
  r! ?7 |2 i  }. {: G, I" x
+ d5 A# U3 M0 R6 K( v# hAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
3 Y& \5 Z; S. L( W% c, L$ a  K& ?. M! `0 m. |% i; o
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:( F5 b$ x' g& [; s3 _
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
5 B3 T& w& @  s, y8 k2 a( D) m2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
' J6 v5 t$ {1 H8 y6 H; l- _3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:, t. [; E, ~2 i" k
begin P_induction arriving
- M+ w) S- l7 E/ O. p    clone 1 load to P_pick(A_induct)
0 ]) H; m! T8 i1 c7 i6 R7 cend最大的系* R; F% h. }& p3 \

- _, B) U9 ]; Vbegin P_pick arriving
( z. ^9 W, x/ p    set A_i to procindex * 10 + 1
5 a# K, V- E6 ?7 R  ^" P    move into Q_induct(procindex)
2 g( N. M, x2 H: ]% D; ]+ g7 b) X    move into pickaisle.induct(procindex)
4 |2 M5 W( R/ b- h' J8 o    /*check the type of pickaisle.induct(i), for your last problem.*/" B# m1 d( M) o" `0 w% S+ W2 `
, E1 S+ I. a" G
    while A_i<=30 do begin4 H) J1 M) p9 K$ W1 Z# c6 E
        travel to pickaisle.con(A_i)9 S5 G8 R* d) u' ]6 ^
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. ^2 a! t( y  g- R4 y
        else wait for 10 sec
) |  e  Z" C% K- o        if A_i=A_leave then send to die5 f. Q0 |$ m) _
        else inc A_i by 1* @" L2 p* M6 l& n
    end) \8 |1 @; E9 N0 I$ r4 k) k, O
end
) h) G8 O* p: Q* Z  j5 u' g7 v3 k/ v9 L! `$ E9 S5 Y9 x# R! E
其中的procindex为整形,代表当前process的序号。
3 {. m2 w/ _0 {, F5 m. ?3 Bstation和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-6-2 08:04 , Processed in 0.016804 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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