设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12794|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) j# B' Z7 U( h, w2 U
" E. J1 e+ Z7 t, 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中的数值,不知道会不会有什么不妥。$ X  e8 z+ g: l6 i

: x) E7 C" y- l/ Y# P) c" C8 w+ J+ @8 w. Rbegin P_read arriving0 H: X/ E+ q) \6 d
    while 1=1 do begin2 Q: d$ j: I! Y" w( }) u
        read A_tote from "data.txt" with delimiter "\n"
; y1 p: G5 \' k        read A_time from "data.txt" with delimiter "\n"
( P! e  Q. ?, M% J        read A_leave from "data.txt" with delimiter "\n"
: ~2 \; _; q9 d) G! j        read A_picks from "data.txt" with delimiter "\n"( s7 ~+ W# _, h" ~  a) f
        set load type to A_tote9 M* p" y1 O2 G2 Q
        if A_tote="tote 1" then set A_induct to 1) `% C$ S: y7 q  T
        else if A_tote="tote 2" then set A_induct to 2
' p6 q# {* X7 x; M3 f            else set A_induct to 3   
+ W, |! v9 x* [/ a: {' h) a/ {        set A_i to 0+ M/ o# a, j. h; A
        clone 1 load to P_induction
' ^% f( K8 ]/ J, h        wait for A_time sec( N+ R. F: b, P3 f& x
    end2 g, F0 B6 r; V) S* A" f
end* L' U  e' [0 V) H/ z: y+ d
( a8 X) R" ^7 z7 }+ E6 Y
begin P_induction arriving, y9 q6 y; E( N, b
    if A_induct=1 then clone 1 load to P_pick1
7 t' Y) g3 ~  d7 x6 D    else if A_induct=2 then clone 1 load to P_pick2
/ W  ^) P% Z) \        else clone 1 load to P_pick3. f1 W3 T9 S( ?0 e  b- u) F4 z% Y! f
end
# F3 K# `2 j; R
% q; K1 S" A# N+ zbegin P_pick1 arriving
* X$ Q4 u9 q, o" W- ^    set A_i to 1
; ?3 {$ H$ k* L# n9 ^) @    move into Q_induct1
- C% `7 E$ E& c; Q8 h2 B    move into pickaisle.induct16 R$ L8 R) a5 N% m8 O; Y
    while A_i<=30 do begin7 K* u! [1 C  Y# t; L/ v& }- [2 G* k
        travel to pickaisle.con(A_i)
6 I6 i% [0 \9 j2 ^5 ?9 L% J        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! c' ]' X- p3 d5 _$ k2 |
        else wait for 10 sec, `- A& k# W9 X
        if A_i=A_leave then send to die7 ]0 o6 y0 W3 @
        else inc A_i by 1
  }- M* ~6 h1 _( @1 Z# i. r    end& R. G5 k. L0 a6 ?. M+ ]
end8 j7 [) a. T5 E" `) a% X3 E# }3 m/ J

* @) d% `8 J$ d" \5 kbegin P_pick2 arriving8 e% c$ d6 P3 C# k9 u) Z
    set A_i to 11
7 |' b7 ?9 Z9 q& ^1 Q2 B    move into Q_induct2. A( S( W# I7 J2 X( @/ ]
    move into pickaisle.induct2
4 X( `% `* i, _1 r    while A_i<=30 do begin8 O* F( V/ ]* _6 {
        travel to pickaisle.con(A_i)
- `$ W, K( N8 o        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ b' J; F, o# o; h
        else wait for 10 sec
3 I) z( V5 |$ j- x4 _9 q9 P5 q        if A_i=A_leave then send to die
) A  f) I3 e! Q/ v- ]. u4 H# S        else inc A_i by 16 ?( o6 q% Q+ J1 z; g* r; S
    end
) E+ ~2 S( }+ ~end
3 S# {- l. c* d1 x8 \: r2 o. \' t$ p5 q: F
begin P_pick3 arriving7 B; z: [/ Y" [1 N. f2 \7 t
    set A_i to 21
, X$ t: z7 B7 }$ F" F    move into Q_induct3& e/ J, z( C) U; B
    move into pickaisle.induct37 X4 Q/ ^5 M1 z% e( u9 G$ o0 Y
    while A_i<=30 do begin' W, e9 a: i0 H$ q/ F
        travel to pickaisle.con(A_i)9 r3 a$ h* x% r: l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 r% t$ V. |: x        else wait for 10 sec
- H& F8 r! M' N- q# m: G( Z        if A_i=A_leave then send to die
; T3 q) U$ p+ Q/ B        else inc A_i by 11 j. b0 \; G% P7 k
    end# m$ W' f" E( Z6 z( U( s: Z
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是个什么东东?) V; }/ l9 I0 c) p8 a
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
" N- _# I( j3 s3 c0 W# E- i
" G" ?* _% S% ^AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。) |+ ?, B( j0 _  k2 [

0 ?6 t1 I3 S9 Y: X另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
8 L) j$ s4 ]& b0 R  Y& E1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
: g" O0 \1 v) b- m! u1 T2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 F: A9 T% {- w  L
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:3 D; A. i0 `+ L: ^
begin P_induction arriving
. ]$ n* |  E0 D; S- Y) n    clone 1 load to P_pick(A_induct)
" b7 c$ ^- N9 xend最大的系' s! C( @0 g. k# p

. d0 ~, u' E- s* v+ sbegin P_pick arriving
# [! ~5 `  f) H. S' L( F    set A_i to procindex * 10 + 14 l" B/ Z  i4 I0 F4 P  O- W% `
    move into Q_induct(procindex)
% B" b4 b/ I" p- {: m! W    move into pickaisle.induct(procindex): q+ T1 p/ g& r  f  i) a
    /*check the type of pickaisle.induct(i), for your last problem.*/2 [$ I" w6 D+ S/ @, K4 H
6 z' {9 |6 a. q2 b. t
    while A_i<=30 do begin
& p# a+ t7 X5 G        travel to pickaisle.con(A_i)" {0 J, a! Z" Y% r: d, n5 V4 I* u% l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" B1 d$ a% M+ b# Q        else wait for 10 sec
4 i) ^2 c/ [* c/ G        if A_i=A_leave then send to die
% l4 L! E& V. H1 f" Q: ~9 D        else inc A_i by 1
2 l5 h% P: f0 _    end, N. q1 {" ?0 @& e0 J4 L3 g
end
3 ]2 G6 _9 M9 ~& X! `+ m3 }
* N( R7 X" i5 ]' t4 Y其中的procindex为整形,代表当前process的序号。
, n3 F1 L% j/ R6 l5 u' N' ~' `, 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-2-21 13:51 , Processed in 0.023478 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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