设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15010|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 |2 C5 A; {% t" a/ @6 R+ [
% L3 i( ?- [  O1 t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。) v0 J+ }8 w2 `& x+ f+ m

- Q0 d9 A6 i# nbegin P_read arriving
- H# u: |5 W) X" z' n' X- F7 I    while 1=1 do begin  z% i3 a1 Q: m- Q1 ~+ d1 q$ K
        read A_tote from "data.txt" with delimiter "\n"  Q6 k% [3 K/ @) Q' N/ X, f
        read A_time from "data.txt" with delimiter "\n"
3 L$ a0 \& y& P        read A_leave from "data.txt" with delimiter "\n"
2 t) ~. v; s# W  W$ S7 P5 G        read A_picks from "data.txt" with delimiter "\n"
$ _6 B4 ^( X! Q5 {1 y        set load type to A_tote
. v* J& r7 h) M. n        if A_tote="tote 1" then set A_induct to 1
, D7 k+ ]& Y. j' \2 |8 B        else if A_tote="tote 2" then set A_induct to 2
3 x) W3 D; {, ?5 P. N            else set A_induct to 3    $ W, g, |8 Z7 Q" D0 ^& W
        set A_i to 0
" A( J, n" Y% O( o        clone 1 load to P_induction
( S/ S6 t) h6 p4 L* L2 |        wait for A_time sec" v3 C6 W: j' D9 O+ S$ n
    end  s. N+ m+ @: W9 v1 D: i
end3 l. v, I# o; [, R' i

7 Z+ X0 Q( n- i+ s2 x* ~begin P_induction arriving# M( e$ [9 a. H6 I3 |2 U
    if A_induct=1 then clone 1 load to P_pick1
( F% j4 P& I( k1 I0 c& x4 L! ~    else if A_induct=2 then clone 1 load to P_pick25 K+ i1 [7 V+ X/ f
        else clone 1 load to P_pick31 r, [3 a3 L, T$ i
end6 @: b3 \. r: \" [+ w* z
1 ~' K" k  a9 [% Z4 s
begin P_pick1 arriving
, L  ?4 M; t* c    set A_i to 1
  B" T9 i. P+ {# A    move into Q_induct1
* }" K3 R/ y5 C' d. [& z    move into pickaisle.induct1
3 Q$ a- x! e0 W7 N    while A_i<=30 do begin& J+ E3 G0 T/ T% @8 [
        travel to pickaisle.con(A_i)
4 b6 x9 Y' t! R+ g  _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 v4 z: y* h! m1 b        else wait for 10 sec1 `. r' W3 N2 o0 |2 ~% n6 ]
        if A_i=A_leave then send to die
2 _/ _0 M5 n- g: i        else inc A_i by 1; o7 H0 t) \& r2 H" D$ Q
    end1 F' x4 [3 j* w1 _5 O( {% u
end4 }2 |" J1 E) [$ A) v" k

7 N! P* M8 S" S5 w2 Q# ]begin P_pick2 arriving
" ?4 V7 z% E, m& u# ?( ]: v    set A_i to 11
. s* H1 }8 w2 b* U    move into Q_induct2
2 ^- N7 n( D1 @  v    move into pickaisle.induct2
" M# G6 W2 H) I7 O    while A_i<=30 do begin  d+ T* X. W% k8 t- ?
        travel to pickaisle.con(A_i)
+ Y/ S; g: ]7 ^$ u2 |        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 u$ |" n# [' c8 e
        else wait for 10 sec' h$ ~" a; b5 J7 O
        if A_i=A_leave then send to die
9 P$ A$ e! N# w% w: w, {' r. J' }        else inc A_i by 1
5 e) ]( X& K8 m( \5 v# a' ^    end
0 _" ~; g& B( q3 J4 aend3 _: g) p/ G' [

; c3 J9 w$ \: ?  C% @3 bbegin P_pick3 arriving) Z. H2 A- G* V: L; |4 b, ^
    set A_i to 21
* p$ `8 V6 r) p/ ~0 y    move into Q_induct3
+ y" t, K+ [5 _( _+ N    move into pickaisle.induct3
# F! m+ F. t8 L3 L    while A_i<=30 do begin4 d+ z; j3 b1 |
        travel to pickaisle.con(A_i)! W, F4 p  C7 U6 Z* ]
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 ]% W/ R; M9 }. C  M2 Z: ?        else wait for 10 sec3 P- J9 s+ r0 f7 E( S+ x
        if A_i=A_leave then send to die: t: m$ G$ X: C" p5 Q+ m
        else inc A_i by 1, Y5 f( ?& C6 W
    end3 Y1 }1 C# D+ p5 a7 F6 o, K1 Y$ h9 m
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是个什么东东?
1 w( Y$ J- y6 e# n3 J9 X! p% emove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
$ l: A; T8 ]' M1 T! i! ^4 _) y
, L1 n3 s9 M" T- D/ ]1 IAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
  i+ S0 }9 D9 }) T9 M1 p7 |, V7 Y5 b1 @, I  y
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ K# s3 ]3 B: }3 q8 G* K5 S
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
' M  e/ a& s" H9 U' g, a2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;5 N0 W  f7 G& h/ i
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
& P' N) z7 ^) o7 t4 c7 V+ cbegin P_induction arriving' \9 I3 F: _! @* K6 j  x4 k. ]: p7 y5 c
    clone 1 load to P_pick(A_induct)8 ^& A* v& K6 e- [1 C) F
end最大的系
7 {4 `1 X: P7 D2 o" K+ h/ Z  T
$ s1 v# q, [7 f& _2 a: Nbegin P_pick arriving" m' Y+ t3 h3 e7 \2 @
    set A_i to procindex * 10 + 1
, j, ?0 D  r( J  v# b    move into Q_induct(procindex)7 {7 `0 M. y. y0 \7 z/ o
    move into pickaisle.induct(procindex)
4 y3 C% L) y7 d& `; Y' A    /*check the type of pickaisle.induct(i), for your last problem.*/
& f7 c" p0 V* D3 c4 v% O/ S+ g  q6 _. L+ Z  w" t0 J- P% `9 p7 F( C! E
    while A_i<=30 do begin3 ?$ z2 `: g- {* w0 N6 Y, C+ J
        travel to pickaisle.con(A_i)
5 m% X/ N* R+ c! I1 C$ {9 Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" B5 _* ?0 |; S8 x$ F  i
        else wait for 10 sec' v* ^. E  i4 y
        if A_i=A_leave then send to die
2 {3 M1 a7 s9 t2 \- ~7 |        else inc A_i by 1
4 z9 n  v$ o8 g/ y/ u6 Z) L    end" p9 v2 S9 v8 s& j
end
$ a$ }0 I5 r! ^; T
0 z: s$ H% `% y+ o+ I其中的procindex为整形,代表当前process的序号。- w2 j; [$ b8 C0 Z* T* H& u' x2 Q
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-8-4 06:46 , Processed in 0.017701 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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