设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15137|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 K- \& I6 M2 m" Z8 D' J4 F" _: 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中的数值,不知道会不会有什么不妥。
- f( f0 P' E3 W8 V" h
& o# M( s- j3 F1 I2 f8 M* ]begin P_read arriving
3 u7 u1 D5 O1 c& K. b    while 1=1 do begin. a" s9 d2 z6 T3 ?, V* k
        read A_tote from "data.txt" with delimiter "\n"
  O. J4 b+ E6 j0 S1 h( ]+ n& n/ w        read A_time from "data.txt" with delimiter "\n"
2 x9 F! P* }7 G) O$ l0 G        read A_leave from "data.txt" with delimiter "\n"9 X" G% w7 ~# f' ?" H/ m  i
        read A_picks from "data.txt" with delimiter "\n"
! Y/ Q* f  ?9 E& k0 p        set load type to A_tote* J3 _' S/ W, A, L' k- h
        if A_tote="tote 1" then set A_induct to 1
9 k9 K- m) c# S' S3 `        else if A_tote="tote 2" then set A_induct to 20 n: ?# i$ d4 w9 ^0 q) z1 j" `
            else set A_induct to 3    " a& w. D; D4 _1 ~
        set A_i to 0
! K. w. Q0 e- h2 I' @        clone 1 load to P_induction$ ?, h  |$ H5 @+ c
        wait for A_time sec9 I* w! V+ I( c1 k
    end! }5 N" A9 G8 E+ w% S) ?3 Z; y$ ?
end! f1 |1 {/ c( j
+ o, k! |  K+ P3 }2 I* P
begin P_induction arriving
. k2 |4 }3 k3 R3 _4 k9 e% m: E    if A_induct=1 then clone 1 load to P_pick1
8 Y  H9 b0 L* `) l' c( A    else if A_induct=2 then clone 1 load to P_pick2
% X, c' @9 D5 F" {        else clone 1 load to P_pick3
, m# S8 ]* g7 x! C9 l8 Send4 Y9 |3 W. K) @( ]

: m4 H4 t$ S  d; a3 S5 @begin P_pick1 arriving9 w9 t; [4 I, W# \$ y" o  U
    set A_i to 18 K( s0 B8 M1 i9 B4 L$ g
    move into Q_induct1
( q- G+ n) E7 ]* g    move into pickaisle.induct1$ V! M3 z0 j( N. D( S' J
    while A_i<=30 do begin+ H- W5 P# G2 m& `* X- `$ {  v
        travel to pickaisle.con(A_i)
/ Y4 y5 \7 f) P6 _2 d3 B8 x        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 m2 M9 A/ W! l! t8 i
        else wait for 10 sec
% P- Y3 r2 ?$ R& H$ M        if A_i=A_leave then send to die
2 H5 b' w( I8 a4 Q' K1 S        else inc A_i by 1
3 _. I+ ]* l( v0 ?    end
1 j7 k2 }4 k8 W; Send) z2 j+ o, h$ L& M8 c9 ]
2 I, z8 O7 W0 {' B
begin P_pick2 arriving
' [, R$ o; B( K5 b+ [: r9 x/ q; u    set A_i to 11& G: p& C( U/ y) j3 \7 g, X/ i
    move into Q_induct27 Z& r& p! R, M, f( w% `7 G
    move into pickaisle.induct2. T  `" P$ A" y8 n
    while A_i<=30 do begin
) [) ]4 x5 h" K3 L8 e) ~" S" H# v        travel to pickaisle.con(A_i)( ]) u" V7 J* n) }6 Q) N
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& B0 q& q# u$ d; W% p+ ]
        else wait for 10 sec
- A4 ?, w  C+ K/ R        if A_i=A_leave then send to die
3 o8 g' Z+ w1 R        else inc A_i by 1
5 S! k! H% A* v0 V4 }    end
# @6 T* G$ G( {8 {$ Fend" n( q% P0 A/ C6 G1 v2 n
: a- L5 H! g/ A. Z5 w/ d: ?/ J, w# ^5 u
begin P_pick3 arriving
. N* F9 }+ E) t0 F. ^5 s, [+ D/ L    set A_i to 219 C5 S" A0 p* u! s" l% a. _
    move into Q_induct3$ G2 l, H( h2 p2 Z0 a
    move into pickaisle.induct3
# H' z9 N# n8 k3 M9 z5 i* J7 Y    while A_i<=30 do begin. t8 v. A" [9 b9 f3 V
        travel to pickaisle.con(A_i)
0 x1 ~! p( O: P' Y8 v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" b( N/ a0 F0 }/ `7 l2 b
        else wait for 10 sec
; U" h  u7 D: `) E9 _+ b1 E        if A_i=A_leave then send to die
* n! W+ x( ]1 n: h* N        else inc A_i by 1+ y7 Z6 B5 x: S' P8 y
    end- w; p3 T5 s  y' k1 S
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是个什么东东?& j! D" r0 {  c( v' f/ H
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?" r" w  S& S* s: I% G

# _( F; w# F4 BAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
( S# G+ r/ M6 ~3 ]: y" w
4 j( Q; l7 ?1 [/ F7 t另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:) V: r' X, _  i' `5 [
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;& M- p& P8 p- D: j3 ^9 n* q2 }8 i6 W
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
$ |/ O9 T# F% w3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
% M" a" B3 a- q+ w( C+ A5 Ybegin P_induction arriving1 x" r' p8 [  M! ^5 E
    clone 1 load to P_pick(A_induct)6 V( t3 |7 ^. ?$ Y2 R# {. n& D+ k
end最大的系: V, T& D  ^0 Z" O% L0 a8 |( j6 I9 \! m
/ g4 d' D8 W2 z8 y$ R
begin P_pick arriving( L! ?# ]: c1 k, R
    set A_i to procindex * 10 + 1/ w: V) G4 s2 [3 A3 {( f( X
    move into Q_induct(procindex)' N/ y8 K, u8 V, c5 {9 ~+ P
    move into pickaisle.induct(procindex)  f; s8 Q, R* a- o% f0 ?
    /*check the type of pickaisle.induct(i), for your last problem.*/5 B( S$ p  g% g3 k' B% `' _8 L

4 ?# R! k2 n" U' [, Z  l: P% \    while A_i<=30 do begin1 h' h6 @4 b% x
        travel to pickaisle.con(A_i)
7 B( b# ~/ a7 k8 s5 H        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" f; ~& N0 j2 {, k        else wait for 10 sec
0 |& I0 w& z6 f: o6 [        if A_i=A_leave then send to die
3 j! o8 z+ c- z# J) X        else inc A_i by 12 G1 x* y6 h5 V  l
    end
( I  l' E. b1 c2 G9 b8 Send
4 Q: c4 h; W0 V: }8 l# }9 k) g5 i4 v# \+ i( \" z- F
其中的procindex为整形,代表当前process的序号。
4 l+ V3 l+ D  b6 ostation和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-13 23:52 , Processed in 0.015962 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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