设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13817|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 R$ ?+ P* ~' a: f5 s! F% ?$ j& |9 X8 [; b2 B  m
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ j1 Q( O# M7 A) f6 @

5 [* a9 C* O' z: M: H! Nbegin P_read arriving
; q) u* w6 Q9 k. v1 I  o' B0 c    while 1=1 do begin. f% Y5 _$ T, ?
        read A_tote from "data.txt" with delimiter "\n"
4 t. Z/ |0 `2 F: z' Y2 r3 g; g        read A_time from "data.txt" with delimiter "\n"
/ [, E! ~$ O5 \  ]        read A_leave from "data.txt" with delimiter "\n"
2 t8 P$ ?, l% t  V. ]5 E        read A_picks from "data.txt" with delimiter "\n"
6 P- U2 C% h1 x4 \- a        set load type to A_tote
( h- N' r  z& K3 H5 t1 ?1 R        if A_tote="tote 1" then set A_induct to 1
  k; ^( c! l6 t5 N        else if A_tote="tote 2" then set A_induct to 2
1 P, m/ S# d7 U$ c            else set A_induct to 3   
8 N- B2 F: W, _1 H8 G        set A_i to 0( R5 R6 D; m, u9 t5 z
        clone 1 load to P_induction) L7 I5 |( p4 h0 R
        wait for A_time sec& w/ h7 S5 v" i1 q7 I
    end
$ t, W+ b% F  A4 T( ]! Q$ A% ~end+ h. J: l+ X2 \  R# O( V/ w

  j7 K. ]  ~- f2 a: l/ kbegin P_induction arriving
. [" l% w: f& C5 s+ o    if A_induct=1 then clone 1 load to P_pick16 x/ v( c9 t0 _/ n6 Q# C. f
    else if A_induct=2 then clone 1 load to P_pick2& D# h# a: n6 D
        else clone 1 load to P_pick3
9 g, q5 Y. A" M2 O, pend
0 O  \+ u5 @  f. J
3 w3 G# n4 [( {9 D8 W+ ?begin P_pick1 arriving
- L* j% o& a2 k4 C    set A_i to 1" `, J& `' K: ?/ K6 c
    move into Q_induct1
+ t4 U, b' W) V( M' ^    move into pickaisle.induct18 @/ Y9 {" u6 g; a1 ^* z. O
    while A_i<=30 do begin
. r! v  W9 T, I        travel to pickaisle.con(A_i)
8 O( e! R! U9 G  [8 y1 X5 k6 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 _+ j6 {5 n/ O; ~* P2 n, u  ^        else wait for 10 sec
: L, _. ?0 s* m  g7 k        if A_i=A_leave then send to die
0 n0 S* X, q" V" T* t0 D        else inc A_i by 1
) t1 i9 R* B2 n5 H    end
2 X% O- [. p; \: e' d+ Qend  `1 i: o7 v0 Y# w7 ~7 j# J

, `/ d2 _0 O8 X7 N3 L, F9 tbegin P_pick2 arriving1 B1 I/ p* P( r7 ^  A5 Y
    set A_i to 11
  A+ P) x, o( y( J1 U. ^& C; U    move into Q_induct2' h$ z3 y5 M8 o  m3 T# k
    move into pickaisle.induct2
8 m( {2 x8 \/ ~2 n* K9 I: ], C2 ]    while A_i<=30 do begin$ C( r( K  b% {6 }1 M& u
        travel to pickaisle.con(A_i)
$ u. Y8 i/ o' y# T3 L% m1 g# ~8 r: {( Q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ V% q6 I- [' b# [0 O; @. \) K
        else wait for 10 sec
2 X% |' }! l- J. U" E& W        if A_i=A_leave then send to die: r4 }7 t) T4 ]5 C" u6 J6 Z
        else inc A_i by 1" p/ x2 n+ s' T$ O; X0 _  ~
    end
; i: `8 X$ U- ~6 U* |" m. Send
3 c" f7 S' I  ^: {, j* `1 X) l- T2 {. i7 k/ z3 U, x$ ]3 y
begin P_pick3 arriving
4 w4 \: T3 i. D7 v4 R* L6 y1 e    set A_i to 21
  t; x. w7 n1 u6 Q    move into Q_induct3
# F0 l: Y: s% I    move into pickaisle.induct3# W. Y! |: \; b, O
    while A_i<=30 do begin
% q$ k: G: [) g4 o0 ^        travel to pickaisle.con(A_i)
$ e: ~+ x% H% g0 q        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& x0 b7 e& b& p. ^5 ]+ G& n
        else wait for 10 sec
5 _  e/ ~; ]7 \4 D        if A_i=A_leave then send to die
6 I; x' |6 z  \6 O. P/ _# B# O        else inc A_i by 1
0 y' d! g# i) J0 ^8 C    end
- _" O2 n; U. U6 r. n) r& \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是个什么东东?$ ~+ e2 a* l$ v$ C' P
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
' }# U4 D. u* L$ T8 j3 p# _( _! M& y' Z: ^; _9 z, p
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
% q' W" c# @) U* t/ I( F1 u3 o
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
9 ~' m# [; z+ P! \, G1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;' k% G# y! M2 e$ @4 K! Q5 L
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;! `( Y3 I  U) m) [  w5 W4 {
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
/ O4 p3 ]* a' K% Gbegin P_induction arriving4 H; Y" A! R8 P( }5 F0 t5 c5 i
    clone 1 load to P_pick(A_induct)
5 ?! ?: g7 o2 o% iend最大的系9 z4 x8 f/ @- S6 y9 Z
; {* G9 k1 \. Q7 y
begin P_pick arriving
  z" b( W0 n5 p* K    set A_i to procindex * 10 + 1
5 y5 K$ l; |5 B4 `* _  u. p3 J    move into Q_induct(procindex)$ g7 z; v" n' k
    move into pickaisle.induct(procindex)
: C% k# H+ d4 I( h/ b3 u6 w6 P3 y    /*check the type of pickaisle.induct(i), for your last problem.*/5 q. G9 ?* `, s

5 [. u9 L7 t7 M* ~, Q: [    while A_i<=30 do begin
) ^" Z( m/ S. L2 T) ]1 [; }        travel to pickaisle.con(A_i)
% ]6 F- `9 X7 u3 m5 C: I# [9 e) H9 V        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* p: y+ {- d3 Y. A+ g9 i% N/ ^
        else wait for 10 sec: _8 f( Z! M8 ?$ W/ w
        if A_i=A_leave then send to die
- Y1 Q" q' j: Q        else inc A_i by 1
3 |5 C* H/ {' h% u: U7 }* x    end
/ X; A0 s- \5 V# V& d) tend# H' u, `2 ?7 s$ d% f  v+ f/ C

$ f' a- T( o2 y: Q5 o* b" r' X其中的procindex为整形,代表当前process的序号。- O! [3 f1 B1 z4 X
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-5-7 20:25 , Processed in 0.014963 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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