设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14220|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" R5 e* r' }, P6 @' }8 a5 @- ^/ P; ^* t& K% y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 u  z# B2 Q- n! m* T  i3 I

: w+ J& Z  w: W  Mbegin P_read arriving
4 Y! M& e# k; I1 A    while 1=1 do begin7 |* J% R% V( ^& y
        read A_tote from "data.txt" with delimiter "\n"9 }" B- D2 k4 [1 ~, R
        read A_time from "data.txt" with delimiter "\n"6 H2 w- w( V5 g5 @4 ?$ k: b7 l
        read A_leave from "data.txt" with delimiter "\n"
; t" b* z" e! {+ [/ P# u8 x        read A_picks from "data.txt" with delimiter "\n"/ w& [) M* K) w8 L# N% K, B8 P
        set load type to A_tote
$ T1 P( f' p/ h        if A_tote="tote 1" then set A_induct to 1; {4 u/ i- e/ _
        else if A_tote="tote 2" then set A_induct to 2
' ^; b: [7 v3 t0 @9 p1 ^+ F$ x            else set A_induct to 3    : }: P" ~( `. s. t; F5 L! z* g
        set A_i to 0
: _0 x, ]! |, ?& U7 @* W        clone 1 load to P_induction
% Q3 V4 [7 r& i, n9 [0 h        wait for A_time sec
; ~6 {- U% H6 k/ f. ]    end
5 ?9 I& B9 V5 B; ?end
% f) j1 I4 a% p; c4 ?" b4 y  h) W: v( I
begin P_induction arriving
& U( F# @+ P9 O: h' B' h    if A_induct=1 then clone 1 load to P_pick1
& Q+ x, F- z) L: t( S+ n- k    else if A_induct=2 then clone 1 load to P_pick2
$ ^. v6 F- o6 n. E( R- K        else clone 1 load to P_pick30 L' U* N- i+ a. G2 u6 [
end
* i; e/ D% S: l6 d/ G0 g, d
) u5 I* v) F7 b5 G( k3 [begin P_pick1 arriving0 ^9 }8 r' i, q, i! l) p& J0 F& {! K7 |
    set A_i to 1/ x4 G+ f, q% c0 Y( y" v0 k
    move into Q_induct1
  ^) c3 l" ]4 Q& Y    move into pickaisle.induct1
9 f3 L( n' h3 t    while A_i<=30 do begin
/ z; e% {6 e$ q        travel to pickaisle.con(A_i)
! m" @# S) F0 N- m# f  ?' P7 ~        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. w) C- d% a6 G' ?3 o% k  s
        else wait for 10 sec! I, x0 w8 l, ?% L# m- K: Q! c
        if A_i=A_leave then send to die
6 ~; u+ O' x6 B2 S        else inc A_i by 1
: `- E0 Y0 v. i4 i5 [+ o    end4 O" S  \( k2 q& x# Q
end" n, R$ t( r' p8 {
& p  B( b! g: D* i+ N- @* t# N0 w& ]
begin P_pick2 arriving+ W2 U5 ^& ?3 f* J0 o1 J
    set A_i to 11
$ A# M, U& p0 l$ W) c    move into Q_induct2
9 x) ]& f* A$ P+ i3 x    move into pickaisle.induct2
9 E: Z. B7 k/ X, H    while A_i<=30 do begin6 G  f) U2 q) x8 m2 A6 m  J2 E
        travel to pickaisle.con(A_i)
1 V# J; X( [5 K. V. E+ g' J7 g        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 x' S  v" D1 Q% E
        else wait for 10 sec
/ g, l& G* s+ F5 I        if A_i=A_leave then send to die
6 v3 m+ E5 E0 d! ~        else inc A_i by 11 `" a4 h9 G$ e* o# _4 }
    end
% v5 W* m, `& C- o4 G1 g; O5 `end
+ c  Z- I( ]% S7 Q* C8 g6 |( B( `5 x2 O
begin P_pick3 arriving
- l8 C5 U5 c7 l0 f  ]1 n    set A_i to 21( \" J9 n2 u+ T' z3 Q: B2 K3 l+ M
    move into Q_induct3
+ H0 [- K/ R  v" t' n0 ^; c    move into pickaisle.induct3
, O1 y" ]2 ^2 ~( q    while A_i<=30 do begin/ t' q7 S' [( E: x8 o
        travel to pickaisle.con(A_i): D/ u6 Y: \  y: g! z9 h1 S) q* U4 J
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& ^% w( P% v( h+ C( n7 C# E        else wait for 10 sec
3 `7 |' A% \4 U        if A_i=A_leave then send to die$ H$ z# A2 }* y* i7 S6 A8 S2 b
        else inc A_i by 1
9 i8 x% f1 w# w% n& E% t    end
) O, d- Y: S0 P' Oend

最佳答案

查看完整内容

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是个什么东东?. @* I/ t! _# E3 S& m% B
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
1 {* F7 b' U/ x1 c$ }7 _& u& t. S' V" N- {# o
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
. S; P, W! n* r' ~, c  l: {; h
' Q: A# D& s0 G& E1 ]7 L: l% P2 x4 @另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
, K  [' k( ]1 f; H8 q8 F1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 v  v$ z' H! n$ w; Y2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
- B  k* }2 K2 R1 c3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
, I* e' q7 X' u) m: f: Cbegin P_induction arriving
- J- x& Q$ o( ?( r" t; d- ]    clone 1 load to P_pick(A_induct)8 C( f3 O3 n+ a' X9 `7 ?
end最大的系
7 M% ~) R& k7 I# x
# q0 A1 ^* ?9 r4 I3 [1 cbegin P_pick arriving
. R( b" q5 i  C8 N: o8 ]    set A_i to procindex * 10 + 1
1 K( ~. }* O5 F0 J( h" @) v! }    move into Q_induct(procindex); n1 x6 H# @5 X  N! p
    move into pickaisle.induct(procindex)
, `5 y$ D4 M2 F' g5 h8 R, Q$ E    /*check the type of pickaisle.induct(i), for your last problem.*/
$ g6 t0 R; g% V$ P. z8 B
5 f; J3 {/ C' F& z6 F! Z' V, z5 o& j' [    while A_i<=30 do begin
- a+ j! v! ~) u& _1 l+ T8 M, m3 k        travel to pickaisle.con(A_i)
  \1 c8 F+ c/ j( E/ D3 v        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 ^( d: N1 z" [- B  n7 ~        else wait for 10 sec
& Z! L5 X# g9 L9 Z3 C        if A_i=A_leave then send to die% |5 v2 S1 I" y
        else inc A_i by 1) M0 B3 ~* P' ^. j" U
    end6 e, S# X3 A& F) B( B: t# k( ?, D
end
: `' n( N) m, D) F2 E. x' ^: E! x" W, M: K2 B- S8 F/ D
其中的procindex为整形,代表当前process的序号。
% d8 w* v( V1 Y8 P0 L1 Bstation和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-6-22 14:18 , Processed in 0.014821 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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