设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13297|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" ?$ m6 X; D& j; t5 ]6 o( K$ w+ {% o0 j9 c& r9 a
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 j+ U" \( z3 z  p
. D! [( _7 p% bbegin P_read arriving+ t* P- n/ p  ]) }* t/ |
    while 1=1 do begin
% Q& M! E7 Q. Q+ a4 V        read A_tote from "data.txt" with delimiter "\n"- r, {1 b( W5 b, ]
        read A_time from "data.txt" with delimiter "\n"4 h7 Y6 ~/ U  R8 R" _
        read A_leave from "data.txt" with delimiter "\n". J4 H9 l4 `9 g$ ~
        read A_picks from "data.txt" with delimiter "\n"- }( J0 \' M  `6 }+ L2 A( S8 x3 c
        set load type to A_tote! F2 a1 f; {8 Y/ U7 S0 F( {' S
        if A_tote="tote 1" then set A_induct to 1+ ~  b: }& v% B: Z
        else if A_tote="tote 2" then set A_induct to 2
4 t" b3 O5 X& Z, u# b. |2 c8 Q            else set A_induct to 3    ' }& c$ r' T% U( o+ b/ \
        set A_i to 0
# R8 N  @" m7 X5 p4 }) o0 N" f        clone 1 load to P_induction; b) n% [9 k% J3 u
        wait for A_time sec) ^9 y# v' H# X& @8 x/ y/ D
    end
# |( _$ N' N* F  W6 G) E, @0 rend# Q3 ]" }+ G& }8 d' A' z
# H$ T4 W/ N/ D5 I
begin P_induction arriving6 d: F! f+ b3 a' p, J* Z
    if A_induct=1 then clone 1 load to P_pick18 @# R" \7 e( F9 q) A5 }) o
    else if A_induct=2 then clone 1 load to P_pick28 ]$ ?: N6 R7 ]9 V5 a
        else clone 1 load to P_pick3
6 @9 G9 S  x& Z( o5 Fend1 t% j. N: }2 q1 W9 W6 O5 @" i

- {& l! U( m, a' n+ s0 ^0 f7 b0 }begin P_pick1 arriving
( Q' ?; E+ J) k2 C6 Z8 {    set A_i to 1+ h0 l3 |, r% E3 W. _4 b
    move into Q_induct1
2 x6 F& a# e$ `: r    move into pickaisle.induct1! X2 J/ T- ]0 Z2 S
    while A_i<=30 do begin) m% \" w& x3 f, k7 \: D; ^
        travel to pickaisle.con(A_i)
$ i/ a% s: V$ Z9 c; {2 d& F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) }; [, C1 |) m
        else wait for 10 sec
. e1 D/ c: v- K        if A_i=A_leave then send to die# x# Y1 T, _& s8 Z$ p
        else inc A_i by 1* I8 ~0 e: g+ L/ ~5 x9 C1 @* N
    end
# j, `0 e% v# W- c& `* Uend
& k' ?' i' p5 g& k7 p* y, ]8 j5 A/ f, T
begin P_pick2 arriving9 h6 R# C- M  ^, z
    set A_i to 11% m# H6 C& x$ l) C- Z0 k3 R
    move into Q_induct2) c* a' [9 [6 \4 f
    move into pickaisle.induct2( f" ~+ O& Y( e* t" p
    while A_i<=30 do begin  b: p/ t" O+ t; {  }
        travel to pickaisle.con(A_i)
4 k" R4 e' c8 v6 [8 C5 d1 H8 _        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 m# u# _5 C9 Y9 f7 J0 l, n! \
        else wait for 10 sec
0 q2 ?% @2 j" g1 D        if A_i=A_leave then send to die5 B7 i$ a0 |* m1 }% \! `
        else inc A_i by 1
" _% y$ H8 c4 X9 |) ?% X    end
& |2 Z* @# u' I: d4 E" I7 nend6 u( F4 r8 w4 D# j
' ]) Y/ x6 I7 k/ N
begin P_pick3 arriving
4 _* A( x  V3 _9 n    set A_i to 21" {# p5 `4 f* C; Y: ^6 k) O: n
    move into Q_induct3" e! x: I+ s$ {- |1 n, q
    move into pickaisle.induct3+ k2 ~/ o% T+ W* v& j
    while A_i<=30 do begin; t. E2 l) D* o) w( W3 {' b
        travel to pickaisle.con(A_i)8 k1 V7 {, w4 V+ a  N" Y( l
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 W; P+ I) p1 s, {        else wait for 10 sec
8 ?$ c- [$ C7 }9 w        if A_i=A_leave then send to die3 K  t( H& C1 x% e5 l8 t0 c
        else inc A_i by 1
& l  t- ]9 z  t0 o1 w8 V    end# ?& Y# t. b7 _2 x
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是个什么东东?1 B7 F" Y9 c4 S! I- S3 |! n6 z3 G
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' U4 D( }  e2 v3 q1 }- d

& z+ `% x! U1 c; _AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。% b) N3 R- c* O1 N8 U
, c2 S7 R8 G! I2 R! {) ?
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:9 A: i7 m7 ^4 k5 c3 `
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 ]( E) L# D: |# x2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;6 T! c3 p1 n7 y$ s
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 O) F/ T5 _- U5 i: G3 Z
begin P_induction arriving1 h. e1 W  J5 _
    clone 1 load to P_pick(A_induct)
, s* C; t2 y: `9 Hend最大的系
, Y* [: W/ h: E: F7 m7 \, e, d+ q; y. l# ?1 \% ~# K
begin P_pick arriving
% k1 H/ u7 t( c1 I9 [# x0 c2 g    set A_i to procindex * 10 + 1
+ S. z/ i1 _! V+ h, b- R    move into Q_induct(procindex)
7 Z( p9 @, f9 H    move into pickaisle.induct(procindex)
7 t7 p& z9 c6 x6 A" E    /*check the type of pickaisle.induct(i), for your last problem.*/
3 V4 v! L2 S. w0 k8 A% O# w' }) A0 R" I: c0 S7 l
    while A_i<=30 do begin7 P, S0 O+ c9 h
        travel to pickaisle.con(A_i); w" p- {) n: k
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" v, P7 W: ?5 T" E$ m0 O        else wait for 10 sec
2 u8 ]2 h; w9 z  w8 n( D, D; {        if A_i=A_leave then send to die' [1 ]& I' a: t/ F2 a. }) T
        else inc A_i by 13 O4 f2 P, V9 z% c4 o. I( V) K
    end
5 E) P0 l# Y: V$ f2 e0 bend4 Q# R" `) F1 a5 x2 N1 A
' @( T9 Y) o% E8 s3 m) H
其中的procindex为整形,代表当前process的序号。
# ]9 q0 s. x* R  h2 vstation和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-4-2 07:37 , Processed in 0.016909 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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