设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15217|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% ?3 b# N+ N6 D& X" q$ {" R9 L
4 l& c$ Q7 ~! f2 P
我的问题是,在每个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 s+ Y* ]) n  |' U0 Y

; z, W$ A+ V9 M: @begin P_read arriving# O( \; y; i" y  q( X
    while 1=1 do begin% w5 w; D! K4 r- t! S5 q: k* _
        read A_tote from "data.txt" with delimiter "\n"
+ z- z# R- w# Z        read A_time from "data.txt" with delimiter "\n"
* D; y" N+ G+ H# C        read A_leave from "data.txt" with delimiter "\n"
9 B* P6 k% ]: D: M( ?4 q  y        read A_picks from "data.txt" with delimiter "\n"5 \; d: i) u0 }7 F3 W
        set load type to A_tote, w1 {, V5 G; o9 _/ g
        if A_tote="tote 1" then set A_induct to 1: P5 r& ?; b; ^! c" \( Q2 n
        else if A_tote="tote 2" then set A_induct to 2
  T! W; Z: Y9 [! I  r% X            else set A_induct to 3   
# ~* U& X  P9 S5 v: I) ~5 @        set A_i to 0$ ^& Y& \0 `0 I6 f7 a
        clone 1 load to P_induction
& i; ~" N3 y9 |2 b        wait for A_time sec$ l6 k. U' Z4 @5 ^2 W
    end" X, y; x9 P8 w
end
$ v# o9 ^6 Z$ O3 E$ e
) q& M3 c% k. P1 `! S# w$ jbegin P_induction arriving
6 Q2 V* a5 _5 i9 ]% o* l. c7 D    if A_induct=1 then clone 1 load to P_pick1
2 W6 O: ~9 y/ I    else if A_induct=2 then clone 1 load to P_pick2
1 T0 d$ f, f" @7 }. E        else clone 1 load to P_pick3
$ d% `# n' k" q) J3 V" Lend
! Y$ p1 Z+ R; j! ?# K9 \, b9 X+ v
9 J% K4 a/ K3 e+ A1 I! e; |begin P_pick1 arriving
6 _9 c7 }4 Q& Y7 h# Z9 d# l& A    set A_i to 1
- D5 H3 G' a1 f( E  O9 u    move into Q_induct1
& Z* `' k; G8 q5 I    move into pickaisle.induct1  F* p0 J  f5 Q0 L5 d1 L0 V
    while A_i<=30 do begin
9 v/ h1 Y8 V/ m$ K6 j" ?/ V        travel to pickaisle.con(A_i)
0 Z9 r! i, A, S! p$ ~- J6 V" o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ P* p4 J& P- R5 O: i& d, v
        else wait for 10 sec( R+ S  t2 Y/ x' G
        if A_i=A_leave then send to die
" d1 j- P  Q" n        else inc A_i by 1
: c& ^5 S2 y% ?    end
" C( `0 b! a; y* lend
; b) f, k8 V" v( h/ l7 y& z# l' P) e, h; l9 T2 I
begin P_pick2 arriving% a* s. p1 L& ?2 I8 ~6 Q
    set A_i to 11
' e: d' \$ Z6 t. O; I5 C    move into Q_induct2. C5 g* c$ U4 {8 _1 l) C! s
    move into pickaisle.induct2( ]6 L0 R3 p  K8 H+ D2 T1 X
    while A_i<=30 do begin
% R5 l( E  T. }        travel to pickaisle.con(A_i)4 m3 M0 U) q+ X9 {7 X) t8 K$ v7 K
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' X% o( D3 `0 }" `7 @        else wait for 10 sec
3 u( z* T' ~3 U4 a        if A_i=A_leave then send to die6 z; ?- c% {6 p/ a7 J
        else inc A_i by 1
; W2 l# [& |* c" d& L5 l2 Y; W    end
* T# ^. V$ @' C+ U3 L2 u" @% }end+ G* ?( W3 O  n2 |3 n) e
' X8 M3 F* f9 |; W; d+ E3 Z# _* D
begin P_pick3 arriving+ f3 E8 _4 `+ J9 v3 J( _
    set A_i to 21
6 F0 m* N$ x  A: ~# U7 Q% Y    move into Q_induct38 l/ O( h; Q7 b7 Y  ]7 i- m
    move into pickaisle.induct3
3 s0 O3 Y6 A0 i4 ?. _% Y; Y# E% ]    while A_i<=30 do begin8 z: S, c+ a4 J  T) N+ T
        travel to pickaisle.con(A_i): f& j/ A" [, e: {  @/ v
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* e5 K- l0 X) W2 @+ V        else wait for 10 sec2 ^( {% M, \% Z1 K( S( a: @
        if A_i=A_leave then send to die
& ^! w6 L" d1 P6 ^3 M( R0 P0 x2 q        else inc A_i by 1. m) |" U$ M% Q( v+ W  b8 s0 J
    end/ F7 {- L6 x3 m2 y6 E
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是个什么东东?0 n& j6 [! o" _* Y* F
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
3 a9 ?4 Z$ n+ O5 y5 \) b4 j$ _5 L7 A4 U1 E) S
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。* B# ~+ `) G+ w- a# x

( z9 |" U6 u- n5 W/ q另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 p) `- m6 k0 h% b2 V
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;# K5 V, v9 t; ?9 q3 `/ ]7 Q
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;4 z5 y! ^7 \+ \
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:0 j% Z) q5 c/ Z7 E, p; `
begin P_induction arriving, l1 }& Z: n* S6 T' n- {
    clone 1 load to P_pick(A_induct)
' k* P& v% z- ^) o; \4 _end最大的系
* j  k3 Y, Q+ ?' M/ c! f) [$ D3 @3 i
begin P_pick arriving
  q) g/ a; m7 ~; A. U+ ^8 i    set A_i to procindex * 10 + 1
. F$ O% n# P; D2 p4 b    move into Q_induct(procindex)
, W2 c1 Z* o- p" v, c6 h- [    move into pickaisle.induct(procindex)
$ o( H! Q5 s  C    /*check the type of pickaisle.induct(i), for your last problem.*/
# t" u& e' D- I! I& |% O1 Y6 J+ U4 q( }) [' C
    while A_i<=30 do begin
: B$ F% ]: T# o( \$ {/ V        travel to pickaisle.con(A_i)
0 a3 L' |2 s2 }! l3 P2 m0 K. Z        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' w, p2 C. Q0 y1 M; ]0 Y% I        else wait for 10 sec
! Z, R) R1 e. b' w+ p        if A_i=A_leave then send to die
/ H. ~) Z# n6 k- {6 c7 |        else inc A_i by 1! A1 S3 z/ h; z0 S
    end2 T. n3 P, ^/ Q7 L, {8 _# k% k
end7 _7 J" r# W7 g7 z, F8 S0 _
# P( w8 L) G5 b; w& X! |
其中的procindex为整形,代表当前process的序号。# D3 W1 y5 q) X5 ~) l% B/ T
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-24 12:45 , Processed in 0.018925 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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