设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15366|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 e5 g: y; H- Z4 I% X
+ O" i" |+ y2 q$ d; J: U7 E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ x# I3 O0 d4 j: O1 ~+ Z! s5 }) R  l) k2 t% j; p. a
begin P_read arriving
# |. B0 u6 o2 e- m/ l4 a. C- O( X( d    while 1=1 do begin
  R; V% ]5 O' w$ U        read A_tote from "data.txt" with delimiter "\n"
8 F7 C: X& j. P        read A_time from "data.txt" with delimiter "\n"
5 \2 S* a( g2 |( f2 _$ t        read A_leave from "data.txt" with delimiter "\n"
$ Z: [3 t* X  e2 C. K        read A_picks from "data.txt" with delimiter "\n"1 r* ^5 |1 P( r, Y2 I- K
        set load type to A_tote
9 t' F3 C4 S. w% Q: C8 _- u        if A_tote="tote 1" then set A_induct to 1$ _: E: {$ R) Q
        else if A_tote="tote 2" then set A_induct to 2
6 G# z. t. {' f7 i* m            else set A_induct to 3    $ W- j6 ], o: y1 N4 l& j; Z1 y7 h
        set A_i to 0
/ }8 s* E! x* e1 A5 v        clone 1 load to P_induction; @6 c1 X, a2 H- s
        wait for A_time sec6 F' y: C! _8 H) O$ C
    end
' Q( _8 r! m+ S, Z) c4 o8 send
0 ~8 i/ L. l& R% G4 w) L. W3 Z0 O2 \' u8 R
begin P_induction arriving  S6 m, l* o8 A
    if A_induct=1 then clone 1 load to P_pick1: ^& _( [3 p3 a: R
    else if A_induct=2 then clone 1 load to P_pick2) f: }1 s3 ^! @! L6 n1 x; k" g# Z6 ]0 Z
        else clone 1 load to P_pick3
( `/ x/ R9 r% o" W0 m! yend
. s+ k; Z6 I* a, X+ V9 K8 ]9 [' y, n# G' \8 C/ p" R. [
begin P_pick1 arriving
% X0 `" x1 v$ u, Q$ _    set A_i to 1
# j  r+ T3 f  M# a    move into Q_induct1. b6 W  Z, J3 j$ Q1 ~2 O5 @% e
    move into pickaisle.induct1- J/ ~1 Q- V1 b" y, M+ L
    while A_i<=30 do begin
1 C# N4 ]( Z  F2 I3 _1 O        travel to pickaisle.con(A_i)
* I0 n9 N2 C7 E% a        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# A1 v  E8 [3 m- }; C" S        else wait for 10 sec& x1 c4 e* ]5 a6 D
        if A_i=A_leave then send to die0 Y8 A2 w; D  A' Q# p  K, c9 }
        else inc A_i by 15 _( B, e  L' S8 }3 s3 c( P3 [* f
    end) W' \( y7 ^0 B. E$ I
end% O1 |, S! n4 t; W$ T) `

. J/ i1 C6 t+ o) ]* sbegin P_pick2 arriving) Q# H# U# M( _( A2 F
    set A_i to 11
% P5 |; T" A) b' a: J% o! S    move into Q_induct28 r. c' g4 x0 }" U7 u9 I6 [+ [
    move into pickaisle.induct2
" ~+ N/ p5 X9 l) ]0 k5 b    while A_i<=30 do begin
8 }% O. v/ M! e1 R5 w        travel to pickaisle.con(A_i)
; J/ ]4 }$ m! f4 ^) R1 ^# S# d        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: |) |' M0 d+ q, z        else wait for 10 sec' O8 S' D6 W4 `" }# q3 S
        if A_i=A_leave then send to die* v, ]1 X  u' D8 k
        else inc A_i by 1
0 M7 `! w3 L$ L6 l4 z1 V    end0 g# @1 u/ P! T. R& c/ B) ?$ p
end8 J4 _. \3 G' `, e
1 ?- W5 n: J, l! [" Q9 K
begin P_pick3 arriving$ n' m# B  s$ r! d6 @# [! `4 ]5 f' C
    set A_i to 21) T6 {8 b6 I" `
    move into Q_induct3
) E# ^( I# g* q2 Q/ W    move into pickaisle.induct3! Q  ?" V  ~1 }. M% \* u
    while A_i<=30 do begin$ B  y* U& B& j
        travel to pickaisle.con(A_i)
7 t+ C+ k2 B7 l        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* k# b7 q2 h5 o- V: u        else wait for 10 sec# b! \2 D6 B8 J# F1 y& H1 x
        if A_i=A_leave then send to die
7 P/ \3 j! P+ J; F$ z/ Z        else inc A_i by 1
6 {. W$ T3 F0 l: b( x( E* `    end
+ l+ J! ^4 F- B1 }8 s# H1 [* iend

最佳答案

查看完整内容

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是个什么东东?
6 v! j- z4 u! a5 e( S1 omove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?3 H& ^2 W/ N$ R* J8 {4 O) Z4 }7 c# o
' i. e# X+ ]# Y
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
6 }. t& h  f2 u& d7 Y# V/ j3 n" o0 I# d! ^- J- z! T1 ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
& [. a" X4 D7 v& M( Y3 S1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
3 W/ H$ w3 X* d$ R3 r' T7 ^8 [! }2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;8 n8 I9 c, W8 _# f/ o
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:. h/ s5 d( g# F* q7 n# o: J
begin P_induction arriving
1 ~9 Y- v) d0 x% w9 D    clone 1 load to P_pick(A_induct)
% S3 |1 M3 q- Send最大的系
( t: e$ |! m) h# y9 k; j( g6 \- m, b7 Z6 M, q1 S/ z# G
begin P_pick arriving) L* i8 S) \# n
    set A_i to procindex * 10 + 17 a( d, P2 u- A
    move into Q_induct(procindex)
" u9 ^3 n4 q( K3 T5 z; k    move into pickaisle.induct(procindex)5 n, W' w$ Z9 c) s
    /*check the type of pickaisle.induct(i), for your last problem.*/0 F' j: C/ ~; t! ?
" o6 t% e* D* g7 j  n: T5 G- }% ?6 k7 |
    while A_i<=30 do begin
& b3 G" o. U% V+ l        travel to pickaisle.con(A_i); r# p: L9 N9 e5 r! o
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ?% f, _) j0 [6 |8 i        else wait for 10 sec# L6 Y7 g5 [- c* S, A
        if A_i=A_leave then send to die# b) z8 X7 C, @# l0 J  S# a
        else inc A_i by 1
9 t) [/ g) f. f: {' l    end# q, O4 o" N# c3 V+ g3 S- ?
end
1 o6 H  C# b8 {, Y3 }2 {. \! e
( B! Q* O! g  e  s6 M其中的procindex为整形,代表当前process的序号。
+ [* a6 s. d( D7 `( rstation和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-9-5 21:26 , Processed in 0.023027 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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