设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11347|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: u/ c3 v: ?, F9 H' c# a1 A

6 h3 A! h) o' b5 Z% l7 ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: y" S( [+ U; E6 L! o; C7 g
0 [, H4 I! e' l: F0 Obegin P_read arriving
% y% m" h( c* b    while 1=1 do begin
: `! Q" ~' N, N6 v; W9 V        read A_tote from "data.txt" with delimiter "\n"
# u: v3 w) J; l) E8 g9 O  B        read A_time from "data.txt" with delimiter "\n", @" t7 V9 [/ L! `+ b4 Q  R
        read A_leave from "data.txt" with delimiter "\n"4 [3 E: J9 }4 o, z" ?7 t
        read A_picks from "data.txt" with delimiter "\n"% j! f. @) B) f( S# K3 a6 @- O- M  G
        set load type to A_tote
. q9 o, S3 c+ f4 |1 w. O7 U! c        if A_tote="tote 1" then set A_induct to 1
7 S: z( _2 e; c; V8 m) H( I4 y        else if A_tote="tote 2" then set A_induct to 2
3 Y9 Z8 q: N- K, t9 p$ E0 j            else set A_induct to 3   
0 s, @; S5 d1 P( h0 F        set A_i to 06 [) e3 V1 R# L7 P, Z$ ?+ T9 p+ z7 D+ E' Z
        clone 1 load to P_induction* j; d* U% S3 M; Y
        wait for A_time sec5 I3 B& ~  R: z! B5 b3 F, g
    end
$ G+ t' _) L9 A- M" t& W: O9 Send, b% f2 }* X* V- c* L8 `
9 ~# v; `. K1 s4 X( @# `* H/ n% a
begin P_induction arriving
9 s' d. |) K% ^7 X* u    if A_induct=1 then clone 1 load to P_pick1
7 c( Z( [: M( b$ t    else if A_induct=2 then clone 1 load to P_pick2- |* T3 T/ v* Y. z3 v9 e, B7 O4 l
        else clone 1 load to P_pick3
! Q& c0 b1 m4 }- Gend
) g( A% M" c, M  U& G; g! V7 H
; ^* ]( n1 F: F$ P& j$ |- I& pbegin P_pick1 arriving% q: G4 l, |8 V  |7 I) p6 X
    set A_i to 1( `. u2 o8 c; G3 F
    move into Q_induct1
6 M0 W* V1 r9 k    move into pickaisle.induct1' t/ Z0 @" C! A5 c
    while A_i<=30 do begin; Q3 j' E" g- z4 Z7 Z
        travel to pickaisle.con(A_i)0 F. l6 ^6 m# H7 z* U
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 z. a! Z1 {8 p. E: C
        else wait for 10 sec
5 Q( w; J3 w% U8 I        if A_i=A_leave then send to die
$ B  x! S& H4 k( @; B3 I        else inc A_i by 1
0 x! o  f( A8 ]2 H3 |    end* b  k2 J, ?6 p- @
end
# I7 d' U6 E8 J! j8 Q( x% B2 [
; y6 Q' s7 G) Y* N( H( ^# ~begin P_pick2 arriving
! {- v: Q! y6 E4 `( B  S    set A_i to 11
+ @( X; Z( S  o$ L( w: R  H    move into Q_induct2  s3 a' Z7 A# H5 I# c, p" L3 a0 I
    move into pickaisle.induct2/ X# p6 S1 V6 k4 C  ^
    while A_i<=30 do begin, S$ I8 ~- a) f2 Y1 q+ ?
        travel to pickaisle.con(A_i)+ I4 X+ F3 ]6 c# w+ \
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* U6 V- _" b* U9 E/ N7 h/ r8 w        else wait for 10 sec
9 F( B  U, H) x9 ^        if A_i=A_leave then send to die3 p! G- x& H4 m3 U6 ^9 F  f: v6 }
        else inc A_i by 1
2 q! p7 g- {3 g* A7 b    end# B9 A7 [9 j6 H. p$ M- q
end" ~) I6 ]% S9 w- H- z. y

, q3 g; S' X6 g5 ^6 ^$ Dbegin P_pick3 arriving
4 o6 u/ H" B3 \  K& O    set A_i to 21, E3 e$ \5 `/ A/ V3 O3 ~/ V
    move into Q_induct3
9 T7 W9 q& L, d+ J( C    move into pickaisle.induct33 P9 ^* k1 v7 c; J# o
    while A_i<=30 do begin! ^# ^  [- F6 Q, [
        travel to pickaisle.con(A_i)' I: E: v" H& O
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ t% |+ a4 r9 f        else wait for 10 sec. G1 x: k) U/ w* d8 e
        if A_i=A_leave then send to die
2 ~' X; C2 a7 S4 T" i        else inc A_i by 1
% G6 W; c/ v" b    end8 z1 X- Q4 x# b8 ~$ a
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是个什么东东?+ X( P- X+ h& C; m& r6 E
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?6 a% s# ?7 F" O! U1 N. K8 g

) l# G" M; G0 `- ?+ L; c9 EAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。: @" b! C1 ?: t" h5 }

$ Q' o/ Y6 x  V1 O% l另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:$ R) m# l% p5 L  {- e
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
9 S' u6 V" d/ L* S2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;1 c( y2 M( f; w! P7 _/ F9 {) E
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:7 I& c8 z- b" T) T2 E: s8 ?
begin P_induction arriving
. S) S2 q8 n/ \, D- ~% X    clone 1 load to P_pick(A_induct)
) J6 F7 G! r; x- R$ O* l$ t2 B2 m; jend最大的系
+ f) v& e; J3 m4 p  N
( F2 x$ K% x  F) a, hbegin P_pick arriving# g* }- @! p/ q  a  u
    set A_i to procindex * 10 + 1
1 C0 ]( T; F8 A4 s% d    move into Q_induct(procindex)2 u- i6 c5 g2 A! X7 o/ o  n
    move into pickaisle.induct(procindex)4 b$ c. ]+ T; V3 z) H  r2 j
    /*check the type of pickaisle.induct(i), for your last problem.*/. u9 Y5 ^& K4 D+ F! w5 u) W

( V! f' v8 {  X1 ]5 ]    while A_i<=30 do begin2 p- ~% A0 T8 ?! z; x' d4 X8 X$ O1 @9 X
        travel to pickaisle.con(A_i)
" b2 p% V, b# S+ G6 F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 U* ^+ m$ w/ }6 A& `& w        else wait for 10 sec
9 L& x) v3 ]" \+ p; A( C# o        if A_i=A_leave then send to die" e% Y) U$ Z# f1 W
        else inc A_i by 1
1 l, c5 {  k  V    end
% b% t6 K0 @! Y% xend4 a, P( G9 }0 e2 `' b" P  `" S
, X7 d; q, Y3 k' p: Y- }
其中的procindex为整形,代表当前process的序号。0 l: A; A2 q* E+ H2 b
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, 2025-11-8 13:09 , Processed in 0.015607 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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